From: Eric Dong Date: Wed, 16 Dec 2015 11:48:27 +0000 (+0000) Subject: BootManagerLib: Check the pointer to avoid use NULL pointer. X-Git-Tag: edk2-stable201903~8246 X-Git-Url: https://git.proxmox.com/?p=mirror_edk2.git;a=commitdiff_plain;h=bd69e72c8abee5a155d0281b392459dfa7837e8a BootManagerLib: Check the pointer to avoid use NULL pointer. Contributed-under: TianoCore Contribution Agreement 1.0 Signed-off-by: Eric Dong Reviewed-by: Liming Gao git-svn-id: https://svn.code.sf.net/p/edk2/code/trunk/edk2@19301 6f19259b-4bc3-4df7-8a09-765794883524 --- diff --git a/MdeModulePkg/Library/BootManagerLib/BootManager.c b/MdeModulePkg/Library/BootManagerLib/BootManager.c index cfeedebc88..dd87250743 100644 --- a/MdeModulePkg/Library/BootManagerLib/BootManager.c +++ b/MdeModulePkg/Library/BootManagerLib/BootManager.c @@ -327,6 +327,9 @@ GroupMultipleLegacyBootOption4SameType ( SetMem (DeviceTypeIndex, sizeof (DeviceTypeIndex), 0xff); GetEfiGlobalVariable2 (L"BootOrder", (VOID **) &BootOrder, &BootOrderSize); + if (BootOrder == NULL) { + return; + } for (Index = 0; Index < BootOrderSize / sizeof (UINT16); Index++) { UnicodeSPrint (OptionName, sizeof (OptionName), L"Boot%04x", BootOrder[Index]);