crypto-native: fix uninitialized variable 89/33789/4
authorGabriel Oginski <gabrielx.oginski@intel.com>
Wed, 22 Sep 2021 10:32:46 +0000 (11:32 +0100)
committerDamjan Marion <dmarion@me.com>
Sun, 7 Nov 2021 04:23:28 +0000 (04:23 +0000)
Type: fix

Fixed coverity-issue CID 208547.
Originally using uninitialized value when calling one function.
This patch fixes the problem by initializing value for one variable.

Signed-off-by: Gabriel Oginski <gabrielx.oginski@intel.com>
Change-Id: Iccfae1e825b4ca4d95a6f724d9b5c51c5addd1b2

src/plugins/crypto_native/aes_gcm.c

index e0c1e6c..09bb06f 100644 (file)
@@ -978,7 +978,7 @@ aes_gcm_dec (u8x16 T, aes_gcm_key_data_t * kd, aes_gcm_counter_t * ctr,
                          n_left - 64, f);
   return aes4_gcm_calc (T, kd, d4, ctr, inv, outv, rounds, 1, n_left, f);
 #else
-  u8x16 d[4];
+  u8x16 d[4] = {};
   while (n_left >= 128)
     {
       T = aes_gcm_calc_double (T, kd, d, ctr, inv, outv, rounds, f);