From 8ff15e8613ed935a931ef869bc956f9ff1a1f4e1 Mon Sep 17 00:00:00 2001 From: Warner Losh Date: Fri, 3 Mar 2017 20:23:23 +0000 Subject: [PATCH] Make sure guid table is compiled before we use it. Sponsored by: Netflix --- lib/libefivar/efivar.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/lib/libefivar/efivar.c b/lib/libefivar/efivar.c index 50e11940d30e..ad638a33e4aa 100644 --- a/lib/libefivar/efivar.c +++ b/lib/libefivar/efivar.c @@ -301,6 +301,7 @@ efi_guid_to_name(efi_guid_t *guid, char **name) size_t i; uint32_t status; + efi_guid_tbl_compile(); for (i = 0; i < nitems(guid_tbl); i++) { if (uuid_equal(guid, &guid_tbl[i].guid, &status)) { *name = strdup(guid_tbl[i].name); @@ -337,6 +338,7 @@ efi_name_to_guid(const char *name, efi_guid_t *guid) { size_t i; + efi_guid_tbl_compile(); for (i = 0; i < nitems(guid_tbl); i++) { if (strcmp(name, guid_tbl[i].name) == 0) { *guid = guid_tbl[i].guid;