From ce5fad41516804f34d52ebb27808255e1263fd0e Mon Sep 17 00:00:00 2001 From: xli24 Date: Fri, 21 May 2010 07:40:24 +0000 Subject: 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 --- IntelFrameworkModulePkg/Universal/BdsDxe/BootMaint/BootOption.c | 2 ++ IntelFrameworkModulePkg/Universal/BdsDxe/BootMaint/Variable.c | 4 +++- 2 files changed, 5 insertions(+), 1 deletion(-) (limited to 'IntelFrameworkModulePkg/Universal/BdsDxe/BootMaint') 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.
+Copyright (c) 2004 - 2010, Intel Corporation. All rights reserved.
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" // -- cgit v1.2.3