Revision: 19301 http://sourceforge.net/p/edk2/code/19301 Author: ydong10 Date: 2015-12-16 11:48:27 +0000 (Wed, 16 Dec 2015) Log Message: ----------- BootManagerLib: Check the pointer to avoid use NULL pointer.
Contributed-under: TianoCore Contribution Agreement 1.0 Signed-off-by: Eric Dong <eric.d...@intel.com> Reviewed-by: Liming Gao <liming....@intel.com> Modified Paths: -------------- trunk/edk2/MdeModulePkg/Library/BootManagerLib/BootManager.c Modified: trunk/edk2/MdeModulePkg/Library/BootManagerLib/BootManager.c =================================================================== --- trunk/edk2/MdeModulePkg/Library/BootManagerLib/BootManager.c 2015-12-16 05:00:32 UTC (rev 19300) +++ trunk/edk2/MdeModulePkg/Library/BootManagerLib/BootManager.c 2015-12-16 11:48:27 UTC (rev 19301) @@ -327,6 +327,9 @@ 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]); ------------------------------------------------------------------------------ _______________________________________________ edk2-commits mailing list edk2-commits@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/edk2-commits