]> git.proxmox.com Git - mirror_edk2.git/commitdiff
CryptoPkg/BaseCryptLib: Fix possible uninitialized use
authorSergei Dmitrouk <sergei@posteo.net>
Tue, 18 May 2021 16:09:42 +0000 (00:09 +0800)
committermergify[bot] <37929162+mergify[bot]@users.noreply.github.com>
Wed, 19 May 2021 01:39:49 +0000 (01:39 +0000)
`Result` can be used uninitialized in both functions after following
either first or second `goto` statement.

Cc: Jiewen Yao <jiewen.yao@intel.com>
Cc: Jian J Wang <jian.j.wang@intel.com>
Cc: Xiaoyu Lu <xiaoyux.lu@intel.com>
Cc: Guomin Jiang <guomin.jiang@intel.com>
Signed-off-by: Sergei Dmitrouk <sergei@posteo.net>
Reviewed-by: Jiewen Yao <Jiewen.yao@intel.com>
CryptoPkg/Library/BaseCryptLib/Pk/CryptRsaPss.c
CryptoPkg/Library/BaseCryptLib/Pk/CryptRsaPssSign.c

index 4009d37d5f918aec20d9e43d3b1a2eaebf83da08..0b2960f06c4ce37c365405cad07c1ea26c58fc80 100644 (file)
@@ -82,6 +82,7 @@ RsaPssVerify (
   EVP_PKEY_CTX *KeyCtx;\r
   CONST EVP_MD  *HashAlg;\r
 \r
+  Result = FALSE;\r
   EvpRsaKey = NULL;\r
   EvpVerifyCtx = NULL;\r
   KeyCtx = NULL;\r
index b66b6f7296ade9d28714d283f7bde2321d269a41..ece765f9ae0a1479ba3b9902dd7f30a535b7a030 100644 (file)
@@ -97,6 +97,7 @@ RsaPssSign (
   EVP_PKEY_CTX          *KeyCtx;\r
   CONST EVP_MD          *HashAlg;\r
 \r
+  Result = FALSE;\r
   EvpRsaKey = NULL;\r
   EvpVerifyCtx = NULL;\r
   KeyCtx = NULL;\r