Add more strict check for MOR variable, besides MOR lock variable.

Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: "Yao, Jiewen" <jiewen.yao@intel.com>
Reviewed-by: "Zhang, Chao B" <chao.b.zhang@intel.com>


git-svn-id: https://svn.code.sf.net/p/edk2/code/trunk/edk2@18383 6f19259b-4bc3-4df7-8a09-765794883524
This commit is contained in:
Yao, Jiewen 2015-09-02 06:29:06 +00:00 committed by jyao1
parent 465be78e4d
commit 776566530b
1 changed files with 8 additions and 7 deletions

View File

@ -143,20 +143,21 @@ SetVariableCheckHandlerMor (
return EFI_INVALID_PARAMETER;
}
//
// Delete not OK
//
if ((DataSize != sizeof(UINT8)) || (Data == NULL) || (Attributes == 0)) {
return EFI_INVALID_PARAMETER;
}
//
// check format
//
if (IsMorLockVariable(VariableName, VendorGuid)) {
//
// Delete not OK
//
if ((DataSize == 0) || (Data == NULL) || (Attributes == 0)) {
return EFI_INVALID_PARAMETER;
}
//
// set to any other value not OK
//
if ((DataSize != sizeof(UINT8)) || ((*(UINT8 *)Data != 1) && (*(UINT8 *)Data != 0))) {
if ((*(UINT8 *)Data != 1) && (*(UINT8 *)Data != 0)) {
return EFI_INVALID_PARAMETER;
}
}