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
This commit is contained in:
xli24 2006-12-06 09:04:37 +00:00
parent 3820a1717b
commit 35d02d76bf
1 changed files with 5 additions and 1 deletions

View File

@ -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;
}