add error handling for input parameter.

git-svn-id: https://edk2.svn.sourceforge.net/svnroot/edk2/trunk/edk2@9583 6f19259b-4bc3-4df7-8a09-765794883524
This commit is contained in:
eric_tian 2009-12-22 07:16:55 +00:00
parent 81c5255cdf
commit 48a0e6bfbd
2 changed files with 11 additions and 1 deletions

View File

@ -1153,6 +1153,11 @@ EmuSetVariable (
if (VariableName == NULL || VariableName[0] == 0 || VendorGuid == NULL) {
return EFI_INVALID_PARAMETER;
}
if (DataSize != 0 && Data == NULL) {
return EFI_INVALID_PARAMETER;
}
//
// Make sure if runtime bit is set, boot service bit is set also
//

View File

@ -1929,6 +1929,11 @@ RuntimeServiceSetVariable (
if (VariableName == NULL || VariableName[0] == 0 || VendorGuid == NULL) {
return EFI_INVALID_PARAMETER;
}
if (DataSize != 0 && Data == NULL) {
return EFI_INVALID_PARAMETER;
}
//
// Make sure if runtime bit is set, boot service bit is set also
//