diff options
author | xli24 <xli24@6f19259b-4bc3-4df7-8a09-765794883524> | 2006-12-06 09:04:37 +0000 |
---|---|---|
committer | xli24 <xli24@6f19259b-4bc3-4df7-8a09-765794883524> | 2006-12-06 09:04:37 +0000 |
commit | 35d02d76bffba0b2ab598ac1151cc02e47ad197e (patch) | |
tree | f69e7e29cfca422aec8f57752604fae851eca97b /EdkModulePkg/Universal/EmuVariable | |
parent | 3820a1717bbe60b0734951fce3cfb4d06b6a1529 (diff) | |
download | edk2-35d02d76bffba0b2ab598ac1151cc02e47ad197e.zip edk2-35d02d76bffba0b2ab598ac1151cc02e47ad197e.tar.gz edk2-35d02d76bffba0b2ab598ac1151cc02e47ad197e.tar.bz2 |
Merge R8 tracker #8375.
Make GetVariable() check Data parameter, and return EFI_INVALID_PARAMETER if it is NULL and DataSize is enough, according to UEFI spec.
git-svn-id: https://edk2.svn.sourceforge.net/svnroot/edk2/trunk/edk2@2061 6f19259b-4bc3-4df7-8a09-765794883524
Diffstat (limited to 'EdkModulePkg/Universal/EmuVariable')
-rw-r--r-- | EdkModulePkg/Universal/EmuVariable/RuntimeDxe/EmuVariable.c | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/EdkModulePkg/Universal/EmuVariable/RuntimeDxe/EmuVariable.c b/EdkModulePkg/Universal/EmuVariable/RuntimeDxe/EmuVariable.c index 093705c..b44da1c 100644 --- a/EdkModulePkg/Universal/EmuVariable/RuntimeDxe/EmuVariable.c +++ b/EdkModulePkg/Universal/EmuVariable/RuntimeDxe/EmuVariable.c @@ -336,8 +336,12 @@ Returns: //
VarDataSize = Variable.CurrPtr->DataSize;
if (*DataSize >= VarDataSize) {
+ if (Data == NULL) {
+ return EFI_INVALID_PARAMETER;
+ }
+
CopyMem (Data, GetVariableDataPtr (Variable.CurrPtr), VarDataSize);
- if (Attributes) {
+ if (Attributes != NULL) {
*Attributes = Variable.CurrPtr->Attributes;
}
|