CryptoPkg/BaseCryptLib: remove some duplicate initializations.
authorPeter Jones <pjones@redhat.com>
Fri, 20 Oct 2017 15:10:18 +0000 (23:10 +0800)
committerLong Qin <qin.long@intel.com>
Tue, 24 Oct 2017 07:20:22 +0000 (15:20 +0800)
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 <pjones@redhat.com>
Reviewed-by: Laszlo Ersek <lersek@redhat.com>
Reviewed-by: Long Qin <qin.long@intel.com>
CryptoPkg/Library/BaseCryptLib/Pk/CryptPkcs7Verify.c

index d564591..bf67a1f 100644 (file)
@@ -612,7 +612,6 @@ Pkcs7GetCertificatesList (
 \r
   if (CtxChain != NULL) {\r
     BufferSize = sizeof (UINT8);\r
-    OldSize    = BufferSize;\r
     CertBuf    = NULL;\r
 \r
     for (Index = 0; ; Index++) {\r
@@ -656,7 +655,6 @@ Pkcs7GetCertificatesList (
 \r
   if (CtxUntrusted != NULL) {\r
     BufferSize = sizeof (UINT8);\r
-    OldSize    = BufferSize;\r
     CertBuf    = NULL;\r
 \r
     for (Index = 0; ; Index++) {\r