public inbox for devel@edk2.groups.io
 help / color / mirror / Atom feed
* [PATCH] SecurityPkg TcgStorageCoreLib: ASSERT to ensure 'ByteSeq' is not NULL
@ 2016-11-21  7:52 Hao Wu
  2016-11-21  7:57 ` Yao, Jiewen
  0 siblings, 1 reply; 2+ messages in thread
From: Hao Wu @ 2016-11-21  7:52 UTC (permalink / raw)
  To: edk2-devel; +Cc: Hao Wu, Eric Dong, Feng Tian

Add ASSERT to make sure 'ByteSeq' is not NULL before comsumed by
CopyMem().

Cc: Eric Dong <eric.dong@intel.com>
Cc: Feng Tian <feng.tian@intel.com>
Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: Hao Wu <hao.a.wu@intel.com>
---
 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



^ permalink raw reply related	[flat|nested] 2+ messages in thread

* Re: [PATCH] SecurityPkg TcgStorageCoreLib: ASSERT to ensure 'ByteSeq' is not NULL
  2016-11-21  7:52 [PATCH] SecurityPkg TcgStorageCoreLib: ASSERT to ensure 'ByteSeq' is not NULL Hao Wu
@ 2016-11-21  7:57 ` Yao, Jiewen
  0 siblings, 0 replies; 2+ messages in thread
From: Yao, Jiewen @ 2016-11-21  7:57 UTC (permalink / raw)
  To: Wu, Hao A, edk2-devel@lists.01.org; +Cc: Wu, Hao A, Tian, Feng, Dong, Eric

Reviewed-by: jiewen.yao@intel.com

> -----Original Message-----
> From: edk2-devel [mailto:edk2-devel-bounces@lists.01.org] On Behalf Of
> Hao Wu
> Sent: Monday, November 21, 2016 3:52 PM
> To: edk2-devel@lists.01.org
> Cc: Wu, Hao A <hao.a.wu@intel.com>; Tian, Feng <feng.tian@intel.com>;
> Dong, Eric <eric.dong@intel.com>
> Subject: [edk2] [PATCH] SecurityPkg TcgStorageCoreLib: ASSERT to ensure
> 'ByteSeq' is not NULL
> 
> Add ASSERT to make sure 'ByteSeq' is not NULL before comsumed by
> CopyMem().
> 
> Cc: Eric Dong <eric.dong@intel.com>
> Cc: Feng Tian <feng.tian@intel.com>
> Contributed-under: TianoCore Contribution Agreement 1.0
> Signed-off-by: Hao Wu <hao.a.wu@intel.com>
> ---
>  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
> 
> _______________________________________________
> edk2-devel mailing list
> edk2-devel@lists.01.org
> https://lists.01.org/mailman/listinfo/edk2-devel


^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2016-11-21  7:57 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2016-11-21  7:52 [PATCH] SecurityPkg TcgStorageCoreLib: ASSERT to ensure 'ByteSeq' is not NULL Hao Wu
2016-11-21  7:57 ` Yao, Jiewen

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox