mirror of https://github.com/acidanthera/audk.git
Fix the issue that ASSERT() at line 1391 incorrectly asserts when order list variable is empty.
git-svn-id: https://edk2.svn.sourceforge.net/svnroot/edk2/trunk/edk2@10564 6f19259b-4bc3-4df7-8a09-765794883524
This commit is contained in:
parent
3ea80ba2e4
commit
c6498c1d45
|
@ -1380,6 +1380,7 @@ BOpt_GetOptionNumber (
|
||||||
OrderListSize = 0;
|
OrderListSize = 0;
|
||||||
OrderList = NULL;
|
OrderList = NULL;
|
||||||
OptionNumber = 0;
|
OptionNumber = 0;
|
||||||
|
Index = 0;
|
||||||
|
|
||||||
UnicodeSPrint (StrTemp, sizeof (StrTemp), L"%sOrder", Type);
|
UnicodeSPrint (StrTemp, sizeof (StrTemp), L"%sOrder", Type);
|
||||||
|
|
||||||
|
@ -1388,14 +1389,15 @@ BOpt_GetOptionNumber (
|
||||||
&gEfiGlobalVariableGuid,
|
&gEfiGlobalVariableGuid,
|
||||||
&OrderListSize
|
&OrderListSize
|
||||||
);
|
);
|
||||||
ASSERT (OrderList != NULL);
|
|
||||||
|
|
||||||
for (OptionNumber = 0; ; OptionNumber++) {
|
for (OptionNumber = 0; ; OptionNumber++) {
|
||||||
|
if (OrderList != NULL) {
|
||||||
for (Index = 0; Index < OrderListSize / sizeof (UINT16); Index++) {
|
for (Index = 0; Index < OrderListSize / sizeof (UINT16); Index++) {
|
||||||
if (OptionNumber == OrderList[Index]) {
|
if (OptionNumber == OrderList[Index]) {
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
if (Index < OrderListSize / sizeof (UINT16)) {
|
if (Index < OrderListSize / sizeof (UINT16)) {
|
||||||
//
|
//
|
||||||
|
|
Loading…
Reference in New Issue