Eric:
  Could you check its return status first, then check its return value? 

-----Original Message-----
From: edk2-devel [mailto:[email protected]] On Behalf Of Eric Dong
Sent: Tuesday, December 15, 2015 9:57 AM
To: [email protected]
Subject: [edk2] [Patch 1/2] BootManagerLib: Check the pointer to avoid use NULL 
pointer.

Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: Eric Dong <[email protected]>
---
 MdeModulePkg/Library/BootManagerLib/BootManager.c | 1 +
 1 file changed, 1 insertion(+)

diff --git a/MdeModulePkg/Library/BootManagerLib/BootManager.c 
b/MdeModulePkg/Library/BootManagerLib/BootManager.c
index cfeedeb..dd9838e 100644
--- a/MdeModulePkg/Library/BootManagerLib/BootManager.c
+++ b/MdeModulePkg/Library/BootManagerLib/BootManager.c
@@ -325,10 +325,11 @@ GroupMultipleLegacyBootOption4SameType (
   EFI_BOOT_MANAGER_LOAD_OPTION BootOption;
 
   SetMem (DeviceTypeIndex, sizeof (DeviceTypeIndex), 0xff);
 
   GetEfiGlobalVariable2 (L"BootOrder", (VOID **) &BootOrder, &BootOrderSize);
+  ASSERT (BootOrder != NULL);
 
   for (Index = 0; Index < BootOrderSize / sizeof (UINT16); Index++) {
     UnicodeSPrint (OptionName, sizeof (OptionName), L"Boot%04x", 
BootOrder[Index]);
     Status = EfiBootManagerVariableToLoadOption (OptionName, &BootOption);
     ASSERT_EFI_ERROR (Status);
-- 
1.9.5.msysgit.1

_______________________________________________
edk2-devel mailing list
[email protected]
https://lists.01.org/mailman/listinfo/edk2-devel
_______________________________________________
edk2-devel mailing list
[email protected]
https://lists.01.org/mailman/listinfo/edk2-devel

Reply via email to