diff options
author | Mark McLoughlin <mark@skynet.ie> | 2003-03-10 03:16:01 +0000 |
---|---|---|
committer | Mark McLoughlin <markmc@src.gnome.org> | 2003-03-10 03:16:01 +0000 |
commit | 27c375f89c1cbbcead19915c8d5dee48b6158483 (patch) | |
tree | 9c778ad85bbb1a75ca7c53762e7c9c3b855f28dd | |
parent | c581ed1a8b9807645d0badd6b37b9fe996b05dd5 (diff) | |
download | gnome-desktop-27c375f89c1cbbcead19915c8d5dee48b6158483.tar.gz |
patch from fourdan@xfce.org for fix memory corruption when
2003-03-10 Mark McLoughlin <mark@skynet.ie>
* gnome-desktop-item.c: (make_spawn_environment_for_sn_context):
patch from fourdan@xfce.org for fix memory corruption when
DESKTOP_STARTUP_ID is already defined. bug #105834.
-rw-r--r-- | libgnome-desktop/ChangeLog | 6 | ||||
-rw-r--r-- | libgnome-desktop/gnome-desktop-item.c | 15 |
2 files changed, 15 insertions, 6 deletions
diff --git a/libgnome-desktop/ChangeLog b/libgnome-desktop/ChangeLog index 41dd843c..fc512959 100644 --- a/libgnome-desktop/ChangeLog +++ b/libgnome-desktop/ChangeLog @@ -1,3 +1,9 @@ +2003-03-10 Mark McLoughlin <mark@skynet.ie> + + * gnome-desktop-item.c: (make_spawn_environment_for_sn_context): + patch from fourdan@xfce.org for fix memory corruption when + DESKTOP_STARTUP_ID is already defined. bug #105834. + 2003-03-06 Andrew Sobala <aes@gnome.org> * gnome-desktop-item.c: (gnome_desktop_item_new_from_uri): remove diff --git a/libgnome-desktop/gnome-desktop-item.c b/libgnome-desktop/gnome-desktop-item.c index caaa77b8..5efe9eca 100644 --- a/libgnome-desktop/gnome-desktop-item.c +++ b/libgnome-desktop/gnome-desktop-item.c @@ -1487,7 +1487,7 @@ make_spawn_environment_for_sn_context (SnLauncherContext *sn_context, char **envp) { char **retval = NULL; - int i; + int i, j; int desktop_startup_id_len; if (envp == NULL) @@ -1500,15 +1500,18 @@ make_spawn_environment_for_sn_context (SnLauncherContext *sn_context, desktop_startup_id_len = strlen ("DESKTOP_STARTUP_ID"); - for (i = 0; envp[i]; i++) { + for (i = 0, j = 0; envp[i]; i++) { if (strncmp (envp[i], "DESKTOP_STARTUP_ID", desktop_startup_id_len) != 0) - retval[i] = g_strdup (envp[i]); + { + retval[j] = g_strdup (envp[i]); + ++j; + } } - retval[i] = g_strdup_printf ("DESKTOP_STARTUP_ID=%s", + retval[j] = g_strdup_printf ("DESKTOP_STARTUP_ID=%s", sn_launcher_context_get_startup_id (sn_context)); - ++i; - retval[i] = NULL; + ++j; + retval[j] = NULL; return retval; } |