]> git.ipfire.org Git - thirdparty/openssl.git/commitdiff
Fix Coverity 1498605 & 1498606: uninitialised value
authorPauli <pauli@openssl.org>
Wed, 16 Mar 2022 03:41:37 +0000 (14:41 +1100)
committerPauli <pauli@openssl.org>
Wed, 6 Jul 2022 00:37:12 +0000 (10:37 +1000)
Both of these are false positives but better to be rid of the issue permanently
than for it to repeatedly return to haunt us.

Reviewed-by: Shane Lontis <shane.lontis@oracle.com>
Reviewed-by: Hugo Landau <hlandau@openssl.org>
(Merged from https://github.com/openssl/openssl/pull/17896)

providers/implementations/ciphers/cipher_des_hw.c
providers/implementations/ciphers/cipher_tdes_default_hw.c

index a77fcc681a4a752626f20e3c122eaafb6364446c..a2d54b46ba116006db689df008ad01a973521f2d 100644 (file)
@@ -136,7 +136,8 @@ static int cipher_hw_des_cfb1_cipher(PROV_CIPHER_CTX *ctx, unsigned char *out,
 {
     size_t n, chunk = MAXCHUNK / 8;
     DES_key_schedule *key = &(((PROV_DES_CTX *)ctx)->dks.ks);
-    unsigned char c[1], d[1];
+    unsigned char c[1];
+    unsigned char d[1] = { 0 };
 
     if (inl < chunk)
         chunk = inl;
index 53cbbad57191d1e589cfbae38351f7325d3a1d10..ccdf3941c86b713efa81b2643ffcd89de92a25f8 100644 (file)
@@ -99,7 +99,8 @@ static int ossl_cipher_hw_tdes_cfb1(PROV_CIPHER_CTX *ctx, unsigned char *out,
 {
     PROV_TDES_CTX *tctx = (PROV_TDES_CTX *)ctx;
     size_t n;
-    unsigned char c[1], d[1];
+    unsigned char c[1];
+    unsigned char d[1] = { 0 };
 
     if (ctx->use_bits == 0)
         inl *= 8;