summaryrefslogtreecommitdiff
path: root/MdeModulePkg
diff options
context:
space:
mode:
authorEric Dong <eric.dong@intel.com>2015-12-16 11:48:27 +0000
committerydong10 <ydong10@Edk2>2015-12-16 11:48:27 +0000
commitbd69e72c8abee5a155d0281b392459dfa7837e8a (patch)
tree604003a558feb84ca8b7aa4117650c95cf9c94c8 /MdeModulePkg
parent982c9c92921e8dc7573b66aec8e531cc24dae341 (diff)
downloadedk2-platforms-bd69e72c8abee5a155d0281b392459dfa7837e8a.tar.xz
BootManagerLib: Check the pointer to avoid use NULL pointer.
Contributed-under: TianoCore Contribution Agreement 1.0 Signed-off-by: Eric Dong <eric.dong@intel.com> Reviewed-by: Liming Gao <liming.gao@intel.com> git-svn-id: https://svn.code.sf.net/p/edk2/code/trunk/edk2@19301 6f19259b-4bc3-4df7-8a09-765794883524
Diffstat (limited to 'MdeModulePkg')
-rw-r--r--MdeModulePkg/Library/BootManagerLib/BootManager.c3
1 files changed, 3 insertions, 0 deletions
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]);