From 63daf2bb952f52b5bb42bb2b231fc11de2e4eb3d Mon Sep 17 00:00:00 2001 From: Simon McVittie Date: Tue, 17 Jan 2017 23:47:51 +0000 Subject: [PATCH] testlibrary: ensure that contents_array is NULL-terminated Otherwise g_strjoinv() wanders off the end into uninitialized memory. Signed-off-by: Simon McVittie --- tests/testlibrary.c | 1 + 1 file changed, 1 insertion(+) diff --git a/tests/testlibrary.c b/tests/testlibrary.c index e41df11c..9fdb7be8 100644 --- a/tests/testlibrary.c +++ b/tests/testlibrary.c @@ -691,6 +691,7 @@ add_extra_installation (const char *id, if (priority != NULL) g_ptr_array_add (contents_array, g_strdup_printf ("Priority=%s", priority)); + g_ptr_array_add (contents_array, NULL); contents_string = g_strjoinv ("\n", (char**)contents_array->pdata); conffile_path = g_strconcat (flatpak_installationsdir, "/", id, ".conf", NULL);