mirror of
https://github.com/clearlinux/swupd-server.git
synced 2026-09-05 21:21:34 +00:00
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:
+1
-1
@@ -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);
|
||||
|
||||
|
||||
Reference in New Issue
Block a user