diff options
Diffstat (limited to 'MdeModulePkg')
-rw-r--r-- | MdeModulePkg/Universal/Variable/RuntimeDxe/VariableSmmRuntimeDxe.c | 10 |
1 files changed, 5 insertions, 5 deletions
diff --git a/MdeModulePkg/Universal/Variable/RuntimeDxe/VariableSmmRuntimeDxe.c b/MdeModulePkg/Universal/Variable/RuntimeDxe/VariableSmmRuntimeDxe.c index 873930ce67..3a87298160 100644 --- a/MdeModulePkg/Universal/Variable/RuntimeDxe/VariableSmmRuntimeDxe.c +++ b/MdeModulePkg/Universal/Variable/RuntimeDxe/VariableSmmRuntimeDxe.c @@ -459,10 +459,6 @@ RuntimeServiceGetVariable ( return EFI_INVALID_PARAMETER;
}
- if ((*DataSize != 0) && (Data == NULL)) {
- return EFI_INVALID_PARAMETER;
- }
-
TempDataSize = *DataSize;
VariableNameSize = StrSize (VariableName);
SmmVariableHeader = NULL;
@@ -527,7 +523,11 @@ RuntimeServiceGetVariable ( goto Done;
}
- CopyMem (Data, (UINT8 *)SmmVariableHeader->Name + SmmVariableHeader->NameSize, SmmVariableHeader->DataSize);
+ if (Data != NULL) {
+ CopyMem (Data, (UINT8 *)SmmVariableHeader->Name + SmmVariableHeader->NameSize, SmmVariableHeader->DataSize);
+ } else {
+ Status = EFI_INVALID_PARAMETER;
+ }
Done:
ReleaseLockOnlyAtBootTime (&mVariableServicesLock);
|