From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mga04.intel.com (mga04.intel.com [192.55.52.120]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ml01.01.org (Postfix) with ESMTPS id 029B081D81 for ; Sun, 20 Nov 2016 23:52:17 -0800 (PST) Received: from orsmga001.jf.intel.com ([10.7.209.18]) by fmsmga104.fm.intel.com with ESMTP; 20 Nov 2016 23:52:17 -0800 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.31,674,1473145200"; d="scan'208";a="1062234677" Received: from shwdeopenpsi014.ccr.corp.intel.com ([10.239.9.34]) by orsmga001.jf.intel.com with ESMTP; 20 Nov 2016 23:52:16 -0800 From: Hao Wu To: edk2-devel@lists.01.org Cc: Hao Wu , Eric Dong , Feng Tian Date: Mon, 21 Nov 2016 15:52:14 +0800 Message-Id: <1479714734-8604-1-git-send-email-hao.a.wu@intel.com> X-Mailer: git-send-email 1.9.5.msysgit.0 Subject: [PATCH] SecurityPkg TcgStorageCoreLib: ASSERT to ensure 'ByteSeq' is not NULL X-BeenThere: edk2-devel@lists.01.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: EDK II Development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 21 Nov 2016 07:52:18 -0000 Add ASSERT to make sure 'ByteSeq' is not NULL before comsumed by CopyMem(). Cc: Eric Dong Cc: Feng Tian Contributed-under: TianoCore Contribution Agreement 1.0 Signed-off-by: Hao Wu --- SecurityPkg/Library/TcgStorageCoreLib/TcgStorageCore.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/SecurityPkg/Library/TcgStorageCoreLib/TcgStorageCore.c b/SecurityPkg/Library/TcgStorageCoreLib/TcgStorageCore.c index e333b55..76b25a3 100644 --- a/SecurityPkg/Library/TcgStorageCoreLib/TcgStorageCore.c +++ b/SecurityPkg/Library/TcgStorageCoreLib/TcgStorageCore.c @@ -1435,6 +1435,8 @@ TcgGetNextTcgUid( return TcgResultFailure; } + ASSERT (ByteSeq != NULL); + CopyMem(Uid, ByteSeq, sizeof(TCG_UID)); return TcgResultSuccess; -- 1.9.5.msysgit.0