Fix g_subprocess_launcher_spawn
authorMatthias Clasen <mclasen@redhat.com>
Thu, 28 Nov 2013 06:34:52 +0000 (01:34 -0500)
committerMatthias Clasen <mclasen@redhat.com>
Thu, 28 Nov 2013 06:34:52 +0000 (01:34 -0500)
This function turns a varargs argument list into a string array,
but forgets to NULL-terminate it. This function was not covered
by unit tests...so it was broken.

gio/gsubprocesslauncher.c

index d6463e3..96f8454 100644 (file)
@@ -701,6 +701,8 @@ g_subprocess_launcher_spawn (GSubprocessLauncher  *launcher,
   while ((arg = va_arg (ap, const gchar *)))
     g_ptr_array_add (args, (gchar *) arg);
 
+  g_ptr_array_add (args, NULL);
+
   result = g_subprocess_launcher_spawnv (launcher, (const gchar * const *) args->pdata, error);
 
   g_ptr_array_free (args, TRUE);