News:

Accounts with zero posts and zero activity during the last months will be deleted periodically to fight SPAM!

Main Menu

possible crash candidate

Started by BlueHazzard, August 09, 2015, 05:57:46 PM

Previous topic - Next topic

BlueHazzard

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

start from Line 442:
    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());
        }
    }


target can be a nullpointer but is never checked against it, and later:
line 470:
    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);
    }

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.
(most of the time I ignore long posts)
[strangers don't send me private messages, I'll ignore them; post a topic in the forum, but first read the rules!]

BlueHazzard

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

greetings