chiark / gitweb /
efi: never call qsort on potentially NULL arrays
authorLennart Poettering <lennart@poettering.net>
Wed, 2 Oct 2013 17:38:09 +0000 (19:38 +0200)
committerLennart Poettering <lennart@poettering.net>
Wed, 2 Oct 2013 17:45:12 +0000 (19:45 +0200)
src/shared/efivars.c

index 1d5b6f9..c015b16 100644 (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;