diff options
author | Star Zeng <star.zeng@intel.com> | 2015-03-09 13:05:55 +0000 |
---|---|---|
committer | lzeng14 <lzeng14@Edk2> | 2015-03-09 13:05:55 +0000 |
commit | 52e764f7965310a3f252795bfc3237b935c0396e (patch) | |
tree | c582344eb6f304bc77a6ff3729add584acdd9c54 /SecurityPkg/VariableAuthenticated | |
parent | 82e47eb22f1873835ef38e2941e266adfe1ff836 (diff) | |
download | edk2-platforms-52e764f7965310a3f252795bfc3237b935c0396e.tar.xz |
SecurityPkg Variable: Keep the behavior of Variable Dxe and SMM drivers consistent
to return EFI_NOT_FOUND when a specified variable doesn't exist and
Data parameter is NULL but DataSize parameter is valid in GetVariable() invocation.
Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: Star Zeng <star.zeng@intel.com>
Reviewed-by: Feng Tian <feng.tian@intel.com>
git-svn-id: https://svn.code.sf.net/p/edk2/code/trunk/edk2@17031 6f19259b-4bc3-4df7-8a09-765794883524
Diffstat (limited to 'SecurityPkg/VariableAuthenticated')
-rw-r--r-- | SecurityPkg/VariableAuthenticated/RuntimeDxe/VariableSmmRuntimeDxe.c | 10 |
1 files changed, 5 insertions, 5 deletions
diff --git a/SecurityPkg/VariableAuthenticated/RuntimeDxe/VariableSmmRuntimeDxe.c b/SecurityPkg/VariableAuthenticated/RuntimeDxe/VariableSmmRuntimeDxe.c index 3e2ed08972..be5c935a88 100644 --- a/SecurityPkg/VariableAuthenticated/RuntimeDxe/VariableSmmRuntimeDxe.c +++ b/SecurityPkg/VariableAuthenticated/RuntimeDxe/VariableSmmRuntimeDxe.c @@ -473,10 +473,6 @@ RuntimeServiceGetVariable ( return EFI_INVALID_PARAMETER;
}
- if ((*DataSize != 0) && (Data == NULL)) {
- return EFI_INVALID_PARAMETER;
- }
-
TempDataSize = *DataSize;
VariableNameSize = StrSize (VariableName);
SmmVariableHeader = NULL;
@@ -541,7 +537,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);
|