]> git.proxmox.com Git - mirror_edk2.git/commitdiff
CryptoPkg BaseCryptLib: Init the content of struct 'CertCtx' before use
authorHao Wu <hao.a.wu@intel.com>
Sun, 10 Jul 2016 01:24:53 +0000 (09:24 +0800)
committerHao Wu <hao.a.wu@intel.com>
Tue, 12 Jul 2016 00:53:19 +0000 (08:53 +0800)
Some fields in structure 'CertCtx' might be used uninitialized in function
Pkcs7GetCertificatesList().

This commit makes sure that 'CertCtx' gets initialized before being used.

Cc: Long Qin <qin.long@intel.com>
Cc: Ye Ting <ting.ye@intel.com>
Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: Hao Wu <hao.a.wu@intel.com>
Reviewed-by: Qin Long <qin.long@intel.com>
Reviewed-by: Ye Ting <ting.ye@intel.com>
CryptoPkg/Library/BaseCryptLib/Pk/CryptPkcs7Verify.c

index 559610d7b24e46cdd9f05828daea6150fb9226c5..efa3796af9fb3db0d5a15b016c605a121c993abc 100644 (file)
@@ -10,7 +10,7 @@
   WrapPkcs7Data(), Pkcs7GetSigners(), Pkcs7Verify() will get UEFI Authenticated\r
   Variable and will do basic check for data structure.\r
 \r
-Copyright (c) 2009 - 2015, Intel Corporation. All rights reserved.<BR>\r
+Copyright (c) 2009 - 2016, Intel Corporation. All rights reserved.<BR>\r
 This program and the accompanying materials\r
 are licensed and made available under the terms and conditions of the BSD License\r
 which accompanies this distribution.  The full text of the license may be found at\r
@@ -489,6 +489,8 @@ Pkcs7GetCertificatesList (
   OldBuf         = NULL;\r
   Signers        = NULL;\r
 \r
+  ZeroMem (&CertCtx, sizeof (CertCtx));\r
+\r
   //\r
   // Parameter Checking\r
   //\r