Bug#532702: [gnome-session] patch

Petr Gajdůšek gajdusek.petr at centrum.cz
Sun Jun 14 20:46:57 UTC 2009


Package: gnome-session
Version: 2.26.1-6
Tags: confirmed,patch,upstream

Hi, this bug is caused by recent upstream changes in
egg/eggdesktopfile.c in function egg_desktop_file_launch(). This
function tries to launch autorun apps defined in desktop files. In case
the desktop file cannot be properly parsed (returned value of function
parse_exec is NULL) all the "launch" stuff is skipped and only cleanup
code is executed (the "out" label). In this cleanup block we try to
free an array of strings (env->pdata) that must be NULL terminated (because we
use g_strfreev()) and  in the case the parsing of desktop file failed
it is simple not NULL terminated array because we skipped the code that adds
NULL to the end of array.

Attached patch simply reverts recent changes from freeing strings of env
array to free each of its string in sequence by calling
g_ptr_array_foreach (env,(GFunc)g_free, NULL) and then free the
remaining array of pointers.

... fill env array ...
.
.
#1199
  command = parse_exec (desktop_file, &docs, error);
  if (!command)
	goto out;
.
.
if (env != NULL)
	g_ptr_array_add (env, NULL);
.
.
#1274 
out:
  if (env)
    {
      g_strfreev ((char **)env->pdata);
      g_ptr_array_free (env, FALSE);
    }
.

should be:
 out:
   if (env)
     {
      g_ptr_array_foreach (env, (GFunc)g_free, NULL);
      g_ptr_array_free (env, TRUE);
     }

Cheers,
Petr
-------------- next part --------------
A non-text attachment was scrubbed...
Name: gnome-session.patch
Type: text/x-patch
Size: 400 bytes
Desc: not available
URL: <http://lists.alioth.debian.org/pipermail/pkg-gnome-maintainers/attachments/20090614/8f100ec7/attachment.bin>


More information about the pkg-gnome-maintainers mailing list