forked from pool/systemd
27 lines
780 B
Diff
27 lines
780 B
Diff
|
From 62678deda2dcd43954bf02f783da01e48c7f8fce Mon Sep 17 00:00:00 2001
|
||
|
From: Lennart Poettering <lennart@poettering.net>
|
||
|
Date: Wed, 2 Oct 2013 19:38:09 +0200
|
||
|
Subject: [PATCH 10/15] efi: never call qsort on potentially NULL arrays
|
||
|
|
||
|
---
|
||
|
src/shared/efivars.c | 3 ++-
|
||
|
1 file changed, 2 insertions(+), 1 deletion(-)
|
||
|
|
||
|
diff --git a/src/shared/efivars.c b/src/shared/efivars.c
|
||
|
index 1d5b6f9..c015b16 100644
|
||
|
--- a/src/shared/efivars.c
|
||
|
+++ b/src/shared/efivars.c
|
||
|
@@ -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;
|
||
|
--
|
||
|
1.8.4
|
||
|
|