Zhang, Chao B
2015-07-15 00:42:49 UTC
ImageVerificationLib passes wrong data buffer size when reading DBX variable, causing heap crash.
Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: Chao Zhang <***@intel.com>
---
SecurityPkg/Library/DxeImageVerificationLib/DxeImageVerificationLib.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/SecurityPkg/Library/DxeImageVerificationLib/DxeImageVerificationLib.c b/SecurityPkg/Library/DxeImageVerificationLib/DxeImageVerificationLib.c
index 3331b68..ca1bdc0 100644
--- a/SecurityPkg/Library/DxeImageVerificationLib/DxeImageVerificationLib.c
+++ b/SecurityPkg/Library/DxeImageVerificationLib/DxeImageVerificationLib.c
@@ -1448,7 +1448,7 @@ IsAllowedByDb (
if (Status == EFI_BUFFER_TOO_SMALL) {
goto Done;
}
- DbxData = (UINT8 *) AllocateZeroPool (DataSize);
+ DbxData = (UINT8 *) AllocateZeroPool (DbxDataSize);
if (DbxData == NULL) {
goto Done;
}
Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: Chao Zhang <***@intel.com>
---
SecurityPkg/Library/DxeImageVerificationLib/DxeImageVerificationLib.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/SecurityPkg/Library/DxeImageVerificationLib/DxeImageVerificationLib.c b/SecurityPkg/Library/DxeImageVerificationLib/DxeImageVerificationLib.c
index 3331b68..ca1bdc0 100644
--- a/SecurityPkg/Library/DxeImageVerificationLib/DxeImageVerificationLib.c
+++ b/SecurityPkg/Library/DxeImageVerificationLib/DxeImageVerificationLib.c
@@ -1448,7 +1448,7 @@ IsAllowedByDb (
if (Status == EFI_BUFFER_TOO_SMALL) {
goto Done;
}
- DbxData = (UINT8 *) AllocateZeroPool (DataSize);
+ DbxData = (UINT8 *) AllocateZeroPool (DbxDataSize);
if (DbxData == NULL) {
goto Done;
}
--
1.9.5.msysgit.1
1.9.5.msysgit.1