[Xfce-bugs] [Bug 9026] New: Crash in _xfce_rc_config_new()

bugzilla-daemon at xfce.org bugzilla-daemon at xfce.org
Fri Jun 15 02:11:14 CEST 2012


https://bugzilla.xfce.org/show_bug.cgi?id=9026

          Priority: Medium
            Bug ID: 9026
          Assignee: xfce-bugs at xfce.org
           Summary: Crash in _xfce_rc_config_new()
        QA Contact: nick at xfce.org
          Severity: normal
    Classification: Xfce
                OS: Linux
          Reporter: tstarling at wikimedia.org
          Hardware: Other
            Status: NEW
           Version: 4.8.2
         Component: General
           Product: Libxfce4util

Created attachment 4503
  --> https://bugzilla.xfce.org/attachment.cgi?id=4503&action=edit
Set simple to NULL after error

_xfce_rc_config_new() crashes if there is an error parsing a config file. The
code is:

  XfceRcSimple *simple = NULL;
  ...
  for (p = paths; *p != NULL; ++p)
    {
      ...
      simple = _xfce_rc_simple_new (simple, *p, TRUE);
      if (!_xfce_rc_simple_parse (simple))
        {
          g_critical ("Failed to parse file %s, ignoring.", *p);
          xfce_rc_close (XFCE_RC (simple));
          continue;
        }
        ...
    }

xfce_rc_close() frees the memory pointed to by simple, so in the next iteration
of the loop, simple is a dangling pointer and a crash is a typical result.
Setting simple to NULL on error would be one way to avoid the crash, I have
attached that as a patch and tested it.

Observed in 4.8.2, but the code error appears to still exist in git master.

-- 
You are receiving this mail because:
You are the assignee for the bug.


More information about the Xfce-bugs mailing list