mirror of
https://github.com/acidanthera/audk.git
synced 2025-04-08 17:05:09 +02:00
MdeModulePkg: UefiBootManagerLib: Update assert condition
In BmFindBootOptionInVariable() we prevent passing a NULL pointer to EfiBootManagerFindLoadOption(). However, it can accept a NULL pointer as the second argument as long as count is zero. This change updates the assert condtion to only assert if the pointer is NULL and the count is non-zero. Signed-off-by: Kenneth Lautner <kenlautner3@gmail.com>
This commit is contained in:
parent
03bc4252fb
commit
f0dc9e1504
@ -147,6 +147,12 @@ BmFindBootOptionInVariable (
|
||||
if (OptionNumber == LoadOptionNumberUnassigned) {
|
||||
BootOptions = EfiBootManagerGetLoadOptions (&BootOptionCount, LoadOptionTypeBoot);
|
||||
|
||||
// Only assert if the BootOption is non-zero
|
||||
if ((BootOptions == NULL) && (BootOptionCount > 0)) {
|
||||
ASSERT (BootOptions != NULL);
|
||||
return LoadOptionNumberUnassigned;
|
||||
}
|
||||
|
||||
Index = EfiBootManagerFindLoadOption (OptionToFind, BootOptions, BootOptionCount);
|
||||
if (Index != -1) {
|
||||
OptionNumber = BootOptions[Index].OptionNumber;
|
||||
|
Loading…
x
Reference in New Issue
Block a user