Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: Yao, Jiewen <[email protected]>
Cc: Zhang, Chao B <[email protected]>
---
.../Tcg/MemoryOverwriteRequestControlLock/TcgMorLock.c | 15 ++++++++-------
1 file changed, 8 insertions(+), 7 deletions(-)
diff --git a/SecurityPkg/Tcg/MemoryOverwriteRequestControlLock/TcgMorLock.c
b/SecurityPkg/Tcg/MemoryOverwriteRequestControlLock/TcgMorLock.c
index 7ca7079..c6f3edc 100644
--- a/SecurityPkg/Tcg/MemoryOverwriteRequestControlLock/TcgMorLock.c
+++ b/SecurityPkg/Tcg/MemoryOverwriteRequestControlLock/TcgMorLock.c
@@ -144,19 +144,20 @@ SetVariableCheckHandlerMor (
}
//
+ // 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;
}
}
--
1.9.5.msysgit.0
_______________________________________________
edk2-devel mailing list
[email protected]
https://lists.01.org/mailman/listinfo/edk2-devel