testlibrary: ensure that contents_array is NULL-terminated

Otherwise g_strjoinv() wanders off the end into uninitialized memory.

Signed-off-by: Simon McVittie <smcv@debian.org>
tingping/wmclass
Simon McVittie 2017-01-17 23:47:51 +00:00 committed by Alexander Larsson
parent 902fb71399
commit 63daf2bb95
1 changed files with 1 additions and 0 deletions

View File

@ -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);