Revision: 17031
http://sourceforge.net/p/edk2/code/17031
Author: lzeng14
Date: 2015-03-09 13:05:55 +0000 (Mon, 09 Mar 2015)
Log Message:
-----------
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 <[email protected]>
Reviewed-by: Feng Tian <[email protected]>
Modified Paths:
--------------
trunk/edk2/SecurityPkg/VariableAuthenticated/RuntimeDxe/VariableSmmRuntimeDxe.c
Modified:
trunk/edk2/SecurityPkg/VariableAuthenticated/RuntimeDxe/VariableSmmRuntimeDxe.c
===================================================================
---
trunk/edk2/SecurityPkg/VariableAuthenticated/RuntimeDxe/VariableSmmRuntimeDxe.c
2015-03-09 13:03:42 UTC (rev 17030)
+++
trunk/edk2/SecurityPkg/VariableAuthenticated/RuntimeDxe/VariableSmmRuntimeDxe.c
2015-03-09 13:05:55 UTC (rev 17031)
@@ -473,10 +473,6 @@
return EFI_INVALID_PARAMETER;
}
- if ((*DataSize != 0) && (Data == NULL)) {
- return EFI_INVALID_PARAMETER;
- }
-
TempDataSize = *DataSize;
VariableNameSize = StrSize (VariableName);
SmmVariableHeader = NULL;
@@ -541,7 +537,11 @@
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);
------------------------------------------------------------------------------
Dive into the World of Parallel Programming The Go Parallel Website, sponsored
by Intel and developed in partnership with Slashdot Media, is your hub for all
things parallel software development, from weekly thought leadership blogs to
news, videos, case studies, tutorials and more. Take a look and join the
conversation now. http://goparallel.sourceforge.net/
_______________________________________________
edk2-commits mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/edk2-commits