From 677e5c0b77745f6c486cd677fcefb266fab01f91 Mon Sep 17 00:00:00 2001 From: czhang46 Date: Tue, 21 Aug 2012 02:12:43 +0000 Subject: Fix TCG protocol TcgDxeHashLogExtendEvent and TcgDxeLogEvent SDL issue Signed-off-by: Chao Zhang Reviewed-by : Fu, Siyuan git-svn-id: https://edk2.svn.sourceforge.net/svnroot/edk2/trunk/edk2@13652 6f19259b-4bc3-4df7-8a09-765794883524 --- SecurityPkg/Tcg/TcgDxe/TcgDxe.c | 14 +++++++++++++- 1 file changed, 13 insertions(+), 1 deletion(-) (limited to 'SecurityPkg/Tcg/TcgDxe') diff --git a/SecurityPkg/Tcg/TcgDxe/TcgDxe.c b/SecurityPkg/Tcg/TcgDxe/TcgDxe.c index fea59c35b6..5ef34d0ba2 100644 --- a/SecurityPkg/Tcg/TcgDxe/TcgDxe.c +++ b/SecurityPkg/Tcg/TcgDxe/TcgDxe.c @@ -352,6 +352,10 @@ TcgDxeLogEvent ( { TCG_DXE_DATA *TcgData; + if (TCGLogData == NULL){ + return EFI_INVALID_PARAMETER; + } + TcgData = TCG_DXE_DATA_FROM_THIS (This); if (TcgData->BsCap.TPMDeactivatedFlag) { @@ -438,7 +442,11 @@ TcgDxeHashLogExtendEventI ( { EFI_STATUS Status; - if (HashDataLen > 0) { + if (HashData == NULL && HashDataLen > 0) { + return EFI_INVALID_PARAMETER; + } + + if (HashDataLen > 0 || HashData != NULL) { Status = TpmCommHashAll ( HashData, (UINTN) HashDataLen, @@ -498,6 +506,10 @@ TcgDxeHashLogExtendEvent ( { TCG_DXE_DATA *TcgData; + if (TCGLogData == NULL || EventLogLastEntry == NULL){ + return EFI_INVALID_PARAMETER; + } + TcgData = TCG_DXE_DATA_FROM_THIS (This); if (TcgData->BsCap.TPMDeactivatedFlag) { -- cgit v1.2.3