Blame SOURCES/0064-efi-never-call-qsort-on-potentially-NULL-arrays.patch
|
|
a4b143 |
From 8744e02186cd7253aebc84043de7455ef0044e2d Mon Sep 17 00:00:00 2001
|
|
|
a4b143 |
From: Lennart Poettering <lennart@poettering.net>
|
|
|
a4b143 |
Date: Wed, 2 Oct 2013 19:38:09 +0200
|
|
|
a4b143 |
Subject: [PATCH] efi: never call qsort on potentially NULL arrays
|
|
|
a4b143 |
|
|
|
a4b143 |
---
|
|
|
a4b143 |
src/shared/efivars.c | 3 ++-
|
|
|
a4b143 |
1 file changed, 2 insertions(+), 1 deletion(-)
|
|
|
a4b143 |
|
|
|
a4b143 |
diff --git a/src/shared/efivars.c b/src/shared/efivars.c
|
|
|
a4b143 |
index 8d004ba..99340c9 100644
|
|
|
a4b143 |
--- a/src/shared/efivars.c
|
|
|
a4b143 |
+++ b/src/shared/efivars.c
|
|
|
a4b143 |
@@ -383,7 +383,8 @@ int efi_get_boot_options(uint16_t **options) {
|
|
|
a4b143 |
list[count ++] = id;
|
|
|
a4b143 |
}
|
|
|
a4b143 |
|
|
|
a4b143 |
- qsort(list, count, sizeof(uint16_t), cmp_uint16);
|
|
|
a4b143 |
+ if (list)
|
|
|
a4b143 |
+ qsort(list, count, sizeof(uint16_t), cmp_uint16);
|
|
|
a4b143 |
|
|
|
a4b143 |
*options = list;
|
|
|
a4b143 |
return count;
|