summaryrefslogtreecommitdiff
path: root/IntelFrameworkModulePkg/Universal/BdsDxe/BootMaint
diff options
context:
space:
mode:
authorxli24 <xli24@6f19259b-4bc3-4df7-8a09-765794883524>2010-05-21 07:40:24 +0000
committerxli24 <xli24@6f19259b-4bc3-4df7-8a09-765794883524>2010-05-21 07:40:24 +0000
commitce5fad41516804f34d52ebb27808255e1263fd0e (patch)
treef8becb5cb1aa0cac7903a53a71114b67b9a11d96 /IntelFrameworkModulePkg/Universal/BdsDxe/BootMaint
parent97ada49f3181ec678dddd25a35437164049793da (diff)
downloadedk2-platforms-ce5fad41516804f34d52ebb27808255e1263fd0e.tar.xz
For BdsDxe module,
1. Fix the risk that local variable is pointed by global pointer, which may be used outside the variable scope. 2. Add more checking for pointers. git-svn-id: https://edk2.svn.sourceforge.net/svnroot/edk2/trunk/edk2@10536 6f19259b-4bc3-4df7-8a09-765794883524
Diffstat (limited to 'IntelFrameworkModulePkg/Universal/BdsDxe/BootMaint')
-rw-r--r--IntelFrameworkModulePkg/Universal/BdsDxe/BootMaint/BootOption.c2
-rw-r--r--IntelFrameworkModulePkg/Universal/BdsDxe/BootMaint/Variable.c4
2 files changed, 5 insertions, 1 deletions
diff --git a/IntelFrameworkModulePkg/Universal/BdsDxe/BootMaint/BootOption.c b/IntelFrameworkModulePkg/Universal/BdsDxe/BootMaint/BootOption.c
index 0eb30f0d31..1ca93fd886 100644
--- a/IntelFrameworkModulePkg/Universal/BdsDxe/BootMaint/BootOption.c
+++ b/IntelFrameworkModulePkg/Universal/BdsDxe/BootMaint/BootOption.c
@@ -1388,6 +1388,8 @@ BOpt_GetOptionNumber (
&gEfiGlobalVariableGuid,
&OrderListSize
);
+ ASSERT (OrderList != NULL);
+
for (OptionNumber = 0; ; OptionNumber++) {
for (Index = 0; Index < OrderListSize / sizeof (UINT16); Index++) {
if (OptionNumber == OrderList[Index]) {
diff --git a/IntelFrameworkModulePkg/Universal/BdsDxe/BootMaint/Variable.c b/IntelFrameworkModulePkg/Universal/BdsDxe/BootMaint/Variable.c
index 2ae2f96689..c7d6bc4ad1 100644
--- a/IntelFrameworkModulePkg/Universal/BdsDxe/BootMaint/Variable.c
+++ b/IntelFrameworkModulePkg/Universal/BdsDxe/BootMaint/Variable.c
@@ -1,7 +1,7 @@
/** @file
Variable operation that will be used by bootmaint
-Copyright (c) 2004 - 2008, Intel Corporation. All rights reserved.<BR>
+Copyright (c) 2004 - 2010, Intel Corporation. All rights reserved.<BR>
This program and the accompanying materials
are licensed and made available under the terms and conditions of the BSD License
which accompanies this distribution. The full text of the license may be found at
@@ -1162,6 +1162,8 @@ Var_UpdateBBSOption (
break;
}
}
+ ASSERT (LegacyDeviceContext != NULL);
+
//
// Update the Variable "LegacyDevOrder"
//