From: Peter Jones Date: Fri, 20 Oct 2017 15:10:18 +0000 (+0800) Subject: CryptoPkg/BaseCryptLib: remove some duplicate initializations. X-Git-Tag: edk2-stable201903~3186 X-Git-Url: https://git.proxmox.com/?p=mirror_edk2.git;a=commitdiff_plain;h=b5a985ca9237b551618cd97b1b71af2fff55e209 CryptoPkg/BaseCryptLib: remove some duplicate initializations. clang-analyzer noticed this: Pk/CryptPkcs7Verify.c:600:5: warning: Value stored to 'OldSize' is never read OldSize = BufferSize; ^ ~~~~~~~~~~ Pk/CryptPkcs7Verify.c:644:5: warning: Value stored to 'OldSize' is never read OldSize = BufferSize; ^ ~~~~~~~~~~ 2 warnings generated. These are each immediately followed by a loop that initializes them (to the same values) a second time, and are otherwise only referenced inside that loop, so there's just no point to these assignments at all. Contributed-under: TianoCore Contribution Agreement 1.1 Signed-off-by: Peter Jones Reviewed-by: Laszlo Ersek Reviewed-by: Long Qin --- diff --git a/CryptoPkg/Library/BaseCryptLib/Pk/CryptPkcs7Verify.c b/CryptoPkg/Library/BaseCryptLib/Pk/CryptPkcs7Verify.c index d564591cb7..bf67a1f569 100644 --- a/CryptoPkg/Library/BaseCryptLib/Pk/CryptPkcs7Verify.c +++ b/CryptoPkg/Library/BaseCryptLib/Pk/CryptPkcs7Verify.c @@ -612,7 +612,6 @@ Pkcs7GetCertificatesList ( if (CtxChain != NULL) { BufferSize = sizeof (UINT8); - OldSize = BufferSize; CertBuf = NULL; for (Index = 0; ; Index++) { @@ -656,7 +655,6 @@ Pkcs7GetCertificatesList ( if (CtxUntrusted != NULL) { BufferSize = sizeof (UINT8); - OldSize = BufferSize; CertBuf = NULL; for (Index = 0; ; Index++) {