mirror of https://github.com/acidanthera/audk.git
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:
parent
982c9c9292
commit
bd69e72c8a
|
@ -327,6 +327,9 @@ GroupMultipleLegacyBootOption4SameType (
|
||||||
SetMem (DeviceTypeIndex, sizeof (DeviceTypeIndex), 0xff);
|
SetMem (DeviceTypeIndex, sizeof (DeviceTypeIndex), 0xff);
|
||||||
|
|
||||||
GetEfiGlobalVariable2 (L"BootOrder", (VOID **) &BootOrder, &BootOrderSize);
|
GetEfiGlobalVariable2 (L"BootOrder", (VOID **) &BootOrder, &BootOrderSize);
|
||||||
|
if (BootOrder == NULL) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
for (Index = 0; Index < BootOrderSize / sizeof (UINT16); Index++) {
|
for (Index = 0; Index < BootOrderSize / sizeof (UINT16); Index++) {
|
||||||
UnicodeSPrint (OptionName, sizeof (OptionName), L"Boot%04x", BootOrder[Index]);
|
UnicodeSPrint (OptionName, sizeof (OptionName), L"Boot%04x", BootOrder[Index]);
|
||||||
|
|
Loading…
Reference in New Issue