summaryrefslogtreecommitdiff
path: root/MdeModulePkg/Universal
diff options
context:
space:
mode:
authoreric_tian <eric_tian@6f19259b-4bc3-4df7-8a09-765794883524>2009-08-11 05:24:12 +0000
committereric_tian <eric_tian@6f19259b-4bc3-4df7-8a09-765794883524>2009-08-11 05:24:12 +0000
commit1d5b25b7159f87612181c00b8be9ae6404d37168 (patch)
treed70972f6ed75dc8931249d54ec736896fbc3d329 /MdeModulePkg/Universal
parent6844f1882f0f4211f12dd055d8cab485db421471 (diff)
downloadedk2-platforms-1d5b25b7159f87612181c00b8be9ae6404d37168.tar.xz
add condition judgment to avoid accessing NULL address if not found existing variable.
git-svn-id: https://edk2.svn.sourceforge.net/svnroot/edk2/trunk/edk2@9038 6f19259b-4bc3-4df7-8a09-765794883524
Diffstat (limited to 'MdeModulePkg/Universal')
-rw-r--r--MdeModulePkg/Universal/Variable/EmuRuntimeDxe/EmuVariable.c6
1 files changed, 4 insertions, 2 deletions
diff --git a/MdeModulePkg/Universal/Variable/EmuRuntimeDxe/EmuVariable.c b/MdeModulePkg/Universal/Variable/EmuRuntimeDxe/EmuVariable.c
index dddc143751..228d7d8cff 100644
--- a/MdeModulePkg/Universal/Variable/EmuRuntimeDxe/EmuVariable.c
+++ b/MdeModulePkg/Universal/Variable/EmuRuntimeDxe/EmuVariable.c
@@ -618,7 +618,7 @@ UpdateVariable (
UINTN VarDataOffset;
UINTN VarSize;
VARIABLE_GLOBAL *Global;
- UINTN NonVolatileVarableStoreSize;
+ UINTN NonVolatileVarableStoreSize;
Global = &mVariableModuleGlobal->VariableGlobal[Physical];
@@ -767,7 +767,9 @@ UpdateVariable (
//
// Mark the old variable as deleted
//
- Variable->CurrPtr->State &= VAR_DELETED;
+ if (Variable->CurrPtr != NULL) {
+ Variable->CurrPtr->State &= VAR_DELETED;
+ }
UpdateVariableInfo (VariableName, VendorGuid, Variable->Volatile, FALSE, TRUE, FALSE, FALSE);