summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorxli24 <xli24@6f19259b-4bc3-4df7-8a09-765794883524>2010-06-03 08:49:46 +0000
committerxli24 <xli24@6f19259b-4bc3-4df7-8a09-765794883524>2010-06-03 08:49:46 +0000
commitc6498c1d459dbdedead7664fd3c6e498a337e4f1 (patch)
treeb0003ac975c779ed7f6f8f6e85b9ce3de8091f17
parent3ea80ba2e4ae19eb564173e203d7bab00055ff56 (diff)
downloadedk2-platforms-c6498c1d459dbdedead7664fd3c6e498a337e4f1.tar.xz
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
-rw-r--r--IntelFrameworkModulePkg/Universal/BdsDxe/BootMaint/BootOption.c10
1 files changed, 6 insertions, 4 deletions
diff --git a/IntelFrameworkModulePkg/Universal/BdsDxe/BootMaint/BootOption.c b/IntelFrameworkModulePkg/Universal/BdsDxe/BootMaint/BootOption.c
index 1ca93fd886..2cfc3b817a 100644
--- a/IntelFrameworkModulePkg/Universal/BdsDxe/BootMaint/BootOption.c
+++ b/IntelFrameworkModulePkg/Universal/BdsDxe/BootMaint/BootOption.c
@@ -1380,6 +1380,7 @@ BOpt_GetOptionNumber (
OrderListSize = 0;
OrderList = NULL;
OptionNumber = 0;
+ Index = 0;
UnicodeSPrint (StrTemp, sizeof (StrTemp), L"%sOrder", Type);
@@ -1388,12 +1389,13 @@ BOpt_GetOptionNumber (
&gEfiGlobalVariableGuid,
&OrderListSize
);
- ASSERT (OrderList != NULL);
for (OptionNumber = 0; ; OptionNumber++) {
- for (Index = 0; Index < OrderListSize / sizeof (UINT16); Index++) {
- if (OptionNumber == OrderList[Index]) {
- break;
+ if (OrderList != NULL) {
+ for (Index = 0; Index < OrderListSize / sizeof (UINT16); Index++) {
+ if (OptionNumber == OrderList[Index]) {
+ break;
+ }
}
}