swupd_create_fullfiles: avoid segfault when nothing changes

In the (unlikely) case that nothing changed between two builds,
get_deduplicated_fullfile_list() segfaults because it uses
manifest->files without checking for NULL, aka the empty list.

Signed-off-by: Patrick Ohly <patrick.ohly@intel.com>
This commit is contained in:
Patrick Ohly
2016-11-15 11:32:23 -08:00
committed by tmarcu
parent 2890a11c5a
commit 1c75f53604
+1 -1
View File
@@ -252,7 +252,7 @@ static GList *get_deduplicated_fullfile_list(struct manifest *manifest)
manifest->files = g_list_sort(manifest->files, file_sort_hash);
list = g_list_first(manifest->files);
while (prev == NULL) {
while (prev == NULL && list != NULL) {
tmp = list->data;
list = g_list_next(list);