From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mout01.posteo.de (mout01.posteo.de [185.67.36.65]) by mx.groups.io with SMTP id smtpd.web12.7983.1620994651978478480 for ; Fri, 14 May 2021 05:17:32 -0700 Authentication-Results: mx.groups.io; dkim=pass header.i=@posteo.net header.s=2017 header.b=WVDmsjIZ; spf=pass (domain: posteo.net, ip: 185.67.36.65, mailfrom: sergei@posteo.net) Received: from submission (posteo.de [89.146.220.130]) by mout01.posteo.de (Postfix) with ESMTPS id 6F1F024002B for ; Fri, 14 May 2021 14:17:30 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=posteo.net; s=2017; t=1620994650; bh=zJgp3TFWQo5ElBYMbza3GqsCwqc0tzEi9sbsIQ42c7M=; h=From:To:Cc:Subject:Date:From; b=WVDmsjIZSmwEWXcwlY/p8T8c7iSvMMeViconNVOvC6g/5ZGIOB16O8BvA3QaxE6nV oELbOpB+ZhHEX0846S0W4aawa+1zAL74KMgZYC/wu+ZkaGD1CYO2zUHEPtP+lzXHZZ opx8mZHLH1x9UXFzRd6KrNGRZvOH7zRMjROcVYFMWax8ztcS5bAdvsUZMxdlB6IJQV 6K4JNW4Io10feAgvP9d41dDCJxzRMwKWUhz4Qcg8GDLtshLFpuVD089YPJDhG3bzKV vNNqJCJAl4q5YZViPYY0BX9euvLUhSLc5Nl4Xhf4gj8M0hl9/jjdVF7UmGwKqXTvDA yp60ZiserifuA== Received: from customer (localhost [127.0.0.1]) by submission (posteo.de) with ESMTPSA id 4FhSG14BcKz9rxS; Fri, 14 May 2021 14:17:29 +0200 (CEST) From: "Sergei Dmitrouk" To: devel@edk2.groups.io Cc: Jiewen Yao , Jian J Wang , Xiaoyu Lu , Guomin Jiang Subject: [PATCH v1 3/3] CryptoPkg/BaseCryptLib: Fix possible uninitialized use Date: Fri, 14 May 2021 12:17:14 +0000 Message-Id: <20210514121714.17312-4-sergei@posteo.net> In-Reply-To: <20210514121714.17312-1-sergei@posteo.net> References: <20210514121714.17312-1-sergei@posteo.net> `Result` can be used uninitialized in both functions after following either first or second `goto` statement. Cc: Jiewen Yao Cc: Jian J Wang Cc: Xiaoyu Lu Cc: Guomin Jiang Signed-off-by: Sergei Dmitrouk --- CryptoPkg/Library/BaseCryptLib/Pk/CryptRsaPss.c | 1 + CryptoPkg/Library/BaseCryptLib/Pk/CryptRsaPssSign.c | 1 + 2 files changed, 2 insertions(+) diff --git a/CryptoPkg/Library/BaseCryptLib/Pk/CryptRsaPss.c b/CryptoPkg/Library/BaseCryptLib/Pk/CryptRsaPss.c index 4009d37d5f91..0b2960f06c4c 100644 --- a/CryptoPkg/Library/BaseCryptLib/Pk/CryptRsaPss.c +++ b/CryptoPkg/Library/BaseCryptLib/Pk/CryptRsaPss.c @@ -82,6 +82,7 @@ RsaPssVerify ( EVP_PKEY_CTX *KeyCtx; CONST EVP_MD *HashAlg; + Result = FALSE; EvpRsaKey = NULL; EvpVerifyCtx = NULL; KeyCtx = NULL; diff --git a/CryptoPkg/Library/BaseCryptLib/Pk/CryptRsaPssSign.c b/CryptoPkg/Library/BaseCryptLib/Pk/CryptRsaPssSign.c index b66b6f7296ad..ece765f9ae0a 100644 --- a/CryptoPkg/Library/BaseCryptLib/Pk/CryptRsaPssSign.c +++ b/CryptoPkg/Library/BaseCryptLib/Pk/CryptRsaPssSign.c @@ -97,6 +97,7 @@ RsaPssSign ( EVP_PKEY_CTX *KeyCtx; CONST EVP_MD *HashAlg; + Result = FALSE; EvpRsaKey = NULL; EvpVerifyCtx = NULL; KeyCtx = NULL; -- 2.17.6