[gnome-software/wip/iainl/ubuntu-xenial] NULL terminate dpkg-deb argv



commit 1fbfbbb159998cef8a6bd305536bda30cda59e0d
Author: William Hua <william hua canonical com>
Date:   Mon Apr 25 04:21:15 2016 -0400

    NULL terminate dpkg-deb argv

 src/plugins/gs-plugin-dpkg.c |    3 ++-
 1 files changed, 2 insertions(+), 1 deletions(-)
---
diff --git a/src/plugins/gs-plugin-dpkg.c b/src/plugins/gs-plugin-dpkg.c
index 125539b..e3eb2da 100644
--- a/src/plugins/gs-plugin-dpkg.c
+++ b/src/plugins/gs-plugin-dpkg.c
@@ -78,7 +78,7 @@ gs_plugin_filename_to_app (GsPlugin *plugin,
                return TRUE;
 
        /* exec sync */
-       argv = g_new0 (gchar *, 4);
+       argv = g_new0 (gchar *, 5);
        argv[0] = g_strdup (DPKG_DEB_BINARY);
        argv[1] = g_strdup ("--showformat=${Package}\\n"
                            "${Version}\\n"
@@ -87,6 +87,7 @@ gs_plugin_filename_to_app (GsPlugin *plugin,
                            "${Description}");
        argv[2] = g_strdup ("-W");
        argv[3] = g_strdup (filename);
+       argv[4] = NULL;
        if (!g_spawn_sync (NULL, argv, NULL,
                           G_SPAWN_SEARCH_PATH | G_SPAWN_STDERR_TO_DEV_NULL,
                           NULL, NULL, &output, NULL, NULL, error))


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]