From: Pauli Date: Wed, 16 Mar 2022 03:30:03 +0000 (+1100) Subject: Fix Coverity 1201740 & 1201712: uninitialised values X-Git-Tag: openssl-3.2.0-alpha1~2687 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=4e720f12fade8d433e5a0eb3ead9017193dac6e7;p=thirdparty%2Fopenssl.git Fix Coverity 1201740 & 1201712: uninitialised values These are both false positives since the `d` array is initialised by the `DES_cfb_encrypt()` call via the `l2cn` macro. Rather than ignoring them and having them crop up later, it's easier to just add an initialiser. Reviewed-by: Matthias St. Pierre Reviewed-by: Dmitry Belyavskiy (Merged from https://github.com/openssl/openssl/pull/17894) --- diff --git a/crypto/evp/e_des.c b/crypto/evp/e_des.c index cd6e5af8d0e..6eb49c03391 100644 --- a/crypto/evp/e_des.c +++ b/crypto/evp/e_des.c @@ -149,7 +149,8 @@ static int des_cfb1_cipher(EVP_CIPHER_CTX *ctx, unsigned char *out, const unsigned char *in, size_t inl) { size_t n, chunk = EVP_MAXCHUNK / 8; - unsigned char c[1], d[1]; + unsigned char c[1]; + unsigned char d[1] = { 0 }; /* Appease Coverity */ if (inl < chunk) chunk = inl; diff --git a/crypto/evp/e_des3.c b/crypto/evp/e_des3.c index 1e159183440..c0bc7fdd8ff 100644 --- a/crypto/evp/e_des3.c +++ b/crypto/evp/e_des3.c @@ -165,7 +165,8 @@ static int des_ede3_cfb1_cipher(EVP_CIPHER_CTX *ctx, unsigned char *out, const unsigned char *in, size_t inl) { size_t n; - unsigned char c[1], d[1]; + unsigned char c[1]; + unsigned char d[1] = { 0 }; /* Appease Coverity */ if (!EVP_CIPHER_CTX_test_flags(ctx, EVP_CIPH_FLAG_LENGTH_BITS)) inl *= 8;