summaryrefslogtreecommitdiff
path: root/CryptoPkg/Library/BaseCryptLib/Hash/CryptSha256.c
diff options
context:
space:
mode:
Diffstat (limited to 'CryptoPkg/Library/BaseCryptLib/Hash/CryptSha256.c')
-rw-r--r--CryptoPkg/Library/BaseCryptLib/Hash/CryptSha256.c6
1 files changed, 6 insertions, 0 deletions
diff --git a/CryptoPkg/Library/BaseCryptLib/Hash/CryptSha256.c b/CryptoPkg/Library/BaseCryptLib/Hash/CryptSha256.c
index 7e6c6c691f..3c2f9a1155 100644
--- a/CryptoPkg/Library/BaseCryptLib/Hash/CryptSha256.c
+++ b/CryptoPkg/Library/BaseCryptLib/Hash/CryptSha256.c
@@ -82,6 +82,12 @@ Sha256Duplicate (
OUT VOID *NewSha256Context
)
{
+ //
+ // ASSERT if Sha256Context or NewSha256Context is NULL.
+ //
+ ASSERT (Sha256Context != NULL);
+ ASSERT (NewSha256Context != NULL);
+
CopyMem (NewSha256Context, Sha256Context, sizeof (SHA256_CTX));
return TRUE;