summaryrefslogtreecommitdiff
path: root/SecurityPkg/Tcg/TcgDxe
diff options
context:
space:
mode:
authorczhang46 <czhang46@6f19259b-4bc3-4df7-8a09-765794883524>2012-08-21 02:12:43 +0000
committerczhang46 <czhang46@6f19259b-4bc3-4df7-8a09-765794883524>2012-08-21 02:12:43 +0000
commit677e5c0b77745f6c486cd677fcefb266fab01f91 (patch)
tree6308d3e855684874279f6053925289224ac7ba53 /SecurityPkg/Tcg/TcgDxe
parent2fa996f9b769d6febb8a0d2e44e05f5ab10a1a0c (diff)
downloadedk2-platforms-677e5c0b77745f6c486cd677fcefb266fab01f91.tar.xz
Fix TCG protocol TcgDxeHashLogExtendEvent and TcgDxeLogEvent SDL issue
Signed-off-by: Chao Zhang <chao.b.zhang@intel.com> Reviewed-by : Fu, Siyuan <siyuan.fu@intel.com> git-svn-id: https://edk2.svn.sourceforge.net/svnroot/edk2/trunk/edk2@13652 6f19259b-4bc3-4df7-8a09-765794883524
Diffstat (limited to 'SecurityPkg/Tcg/TcgDxe')
-rw-r--r--SecurityPkg/Tcg/TcgDxe/TcgDxe.c14
1 files changed, 13 insertions, 1 deletions
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) {