mirror of https://github.com/acidanthera/audk.git
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
This commit is contained in:
parent
6844f1882f
commit
1d5b25b715
|
@ -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);
|
||||
|
||||
|
|
Loading…
Reference in New Issue