From 0e64bf5b379db11cd3e2ca53dbaf4af58d5c9d5a Mon Sep 17 00:00:00 2001 From: Tor Lillqvist Date: Mon, 16 Dec 2002 05:20:15 +0000 Subject: [PATCH] Fix potential heap corruption. Sometimes called g_free() on string 2002-12-16 Tor Lillqvist * glib/gspawn-win32.c (do_spawn): Fix potential heap corruption. Sometimes called g_free() on string literal. --- ChangeLog | 5 +++++ ChangeLog.pre-2-10 | 5 +++++ ChangeLog.pre-2-12 | 5 +++++ ChangeLog.pre-2-2 | 5 +++++ ChangeLog.pre-2-4 | 5 +++++ ChangeLog.pre-2-6 | 5 +++++ ChangeLog.pre-2-8 | 5 +++++ glib/gspawn-win32.c | 3 ++- 8 files changed, 37 insertions(+), 1 deletion(-) diff --git a/ChangeLog b/ChangeLog index 857498d36..54c3df5d1 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,8 @@ +2002-12-16 Tor Lillqvist + + * glib/gspawn-win32.c (do_spawn): Fix potential heap + corruption. Sometimes called g_free() on string literal. + Sat Dec 14 21:24:04 2002 Owen Taylor * glib/gutils.c (g_get_any_init): HP-UX 10 xshares the diff --git a/ChangeLog.pre-2-10 b/ChangeLog.pre-2-10 index 857498d36..54c3df5d1 100644 --- a/ChangeLog.pre-2-10 +++ b/ChangeLog.pre-2-10 @@ -1,3 +1,8 @@ +2002-12-16 Tor Lillqvist + + * glib/gspawn-win32.c (do_spawn): Fix potential heap + corruption. Sometimes called g_free() on string literal. + Sat Dec 14 21:24:04 2002 Owen Taylor * glib/gutils.c (g_get_any_init): HP-UX 10 xshares the diff --git a/ChangeLog.pre-2-12 b/ChangeLog.pre-2-12 index 857498d36..54c3df5d1 100644 --- a/ChangeLog.pre-2-12 +++ b/ChangeLog.pre-2-12 @@ -1,3 +1,8 @@ +2002-12-16 Tor Lillqvist + + * glib/gspawn-win32.c (do_spawn): Fix potential heap + corruption. Sometimes called g_free() on string literal. + Sat Dec 14 21:24:04 2002 Owen Taylor * glib/gutils.c (g_get_any_init): HP-UX 10 xshares the diff --git a/ChangeLog.pre-2-2 b/ChangeLog.pre-2-2 index 857498d36..54c3df5d1 100644 --- a/ChangeLog.pre-2-2 +++ b/ChangeLog.pre-2-2 @@ -1,3 +1,8 @@ +2002-12-16 Tor Lillqvist + + * glib/gspawn-win32.c (do_spawn): Fix potential heap + corruption. Sometimes called g_free() on string literal. + Sat Dec 14 21:24:04 2002 Owen Taylor * glib/gutils.c (g_get_any_init): HP-UX 10 xshares the diff --git a/ChangeLog.pre-2-4 b/ChangeLog.pre-2-4 index 857498d36..54c3df5d1 100644 --- a/ChangeLog.pre-2-4 +++ b/ChangeLog.pre-2-4 @@ -1,3 +1,8 @@ +2002-12-16 Tor Lillqvist + + * glib/gspawn-win32.c (do_spawn): Fix potential heap + corruption. Sometimes called g_free() on string literal. + Sat Dec 14 21:24:04 2002 Owen Taylor * glib/gutils.c (g_get_any_init): HP-UX 10 xshares the diff --git a/ChangeLog.pre-2-6 b/ChangeLog.pre-2-6 index 857498d36..54c3df5d1 100644 --- a/ChangeLog.pre-2-6 +++ b/ChangeLog.pre-2-6 @@ -1,3 +1,8 @@ +2002-12-16 Tor Lillqvist + + * glib/gspawn-win32.c (do_spawn): Fix potential heap + corruption. Sometimes called g_free() on string literal. + Sat Dec 14 21:24:04 2002 Owen Taylor * glib/gutils.c (g_get_any_init): HP-UX 10 xshares the diff --git a/ChangeLog.pre-2-8 b/ChangeLog.pre-2-8 index 857498d36..54c3df5d1 100644 --- a/ChangeLog.pre-2-8 +++ b/ChangeLog.pre-2-8 @@ -1,3 +1,8 @@ +2002-12-16 Tor Lillqvist + + * glib/gspawn-win32.c (do_spawn): Fix potential heap + corruption. Sometimes called g_free() on string literal. + Sat Dec 14 21:24:04 2002 Owen Taylor * glib/gutils.c (g_get_any_init): HP-UX 10 xshares the diff --git a/glib/gspawn-win32.c b/glib/gspawn-win32.c index 8222fefb1..16379e7c1 100644 --- a/glib/gspawn-win32.c +++ b/glib/gspawn-win32.c @@ -603,9 +603,10 @@ do_spawn (gboolean dont_wait, } if (working_directory && *working_directory) + /* The g_strdup() to lose the constness */ new_argv[ARG_WORKING_DIRECTORY] = g_strdup (working_directory); else - new_argv[ARG_WORKING_DIRECTORY] = "-"; + new_argv[ARG_WORKING_DIRECTORY] = g_strdup ("-"); if (close_descriptors) new_argv[ARG_CLOSE_DESCRIPTORS] = "y";