Developer forums (C::B DEVELOPMENT STRICTLY!) > Development

possible crash candidate

(1/1)

BlueHazzard:
Hi
i have found a possible crash candidate in macrosmanager.cpp:

start from Line 442:

--- Code: ---    if (!target)
    {
        if (project)
        {
            // use the currently compiling target
            target = project->GetCurrentlyCompilingTarget();
            // if none,
            if (!target)
                // use the last known active target
                target = project->GetBuildTarget(project->GetActiveBuildTarget());
        }
    }
--- End code ---

target can be a nullpointer but is never checked against it, and later:
line 470:

--- Code: ---    while (m_RE_Script.Matches(buffer))
    {
        search = m_RE_Script.GetMatch(buffer, 1);
        wxString sc_name(_T("Replace Macro Target: "));
        sc_name.Append(target->GetTitle());
        replace = Manager::Get()->GetScriptingManager()->LoadBufferRedirectOutput(m_RE_Script.GetMatch(buffer, 2),sc_name);
        buffer.Replace(search, replace, false);
    }

--- End code ---
it is used.

I work on my sqrat port and get a crash here. I'm still investigating why, but there should be a check for nullptr anyway

greetings

oBFusCATed:
Post a patch please or some detailed steps to reproduce, even if it is against your branch.

BlueHazzard:
mea culpa, i added this code by myself and fixed it now.

greetings

Navigation

[0] Message Index

Go to full version