Author Topic: possible crash candidate  (Read 2871 times)

Offline BlueHazzard

  • Developer
  • Lives here!
  • *****
  • Posts: 3287
possible crash candidate
« on: August 09, 2015, 05:57:46 pm »
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());
        }
    }

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);
    }
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

Offline oBFusCATed

  • Developer
  • Lives here!
  • *****
  • Posts: 13438
    • Travis build status
Re: possible crash candidate
« Reply #1 on: August 09, 2015, 06:01:12 pm »
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!]

Offline BlueHazzard

  • Developer
  • Lives here!
  • *****
  • Posts: 3287
Re: possible crash candidate
« Reply #2 on: August 10, 2015, 12:16:42 am »
mea culpa, i added this code by myself and fixed it now.

greetings