efi: never call qsort on potentially NULL arrays

This commit is contained in:
Lennart Poettering
2014-02-23 12:01:35 +00:00
committed by Colin Guthrie
parent 48fdd931a8
commit 0bf9388b5c
+2 -1
View File
@@ -384,7 +384,8 @@ int efi_get_boot_options(uint16_t **options) {
list[count ++] = id;
}
qsort(list, count, sizeof(uint16_t), cmp_uint16);
if (list)
qsort(list, count, sizeof(uint16_t), cmp_uint16);
*options = list;
return count;