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
This commit is contained in:
Eric Dong 2015-12-16 11:48:27 +00:00 committed by ydong10
parent 982c9c9292
commit bd69e72c8a
1 changed files with 3 additions and 0 deletions

View File

@ -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]);