Skip to contentSkip to conversation

crypto: Uninitialized variable fix.

PATCH In review Atul Sowani 2 participants 2 messages Feb 25, 2011 Crypto API

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 crypto: Uninitialized variable fix.

Array inter[4] was uninitialized in anubis_crypt() and was causing compiler warning. Added the array initialization.

---

crypto/anubis.c 2011-02-25 23:07:12.000000000 +0530 renamed from crypto/anubis.c 2011-02-25 04:39:00.000000000 +0530 +1 -1
diff a/crypto/anubis.c b/crypto/anubis.c
@@ -578,7 +578,7 @@ static void anubis_crypt(u32 roundKey[AN
        __be32 *dst = (__be32 *)ciphertext;
        int i, r;
        u32 state[4];
-       u32 inter[4];
+       u32 inter[4] = { 0, 0, 0, 0 };
 
        /*
         * map plaintext block to cipher state (mu)
#1 lore raw
Quoted 10 lines · Atul Sowani

Array inter[4] was uninitialized in anubis_crypt() and was causing compiler warning. Added the array initialization.

---

diff a/crypto/anubis.c b/crypto/anubis.c

crypto/anubis.c 2011-02-25 23:07:12.000000000 +0530 static void anubis_crypt(u32 roundKey[AN · line 581

Quoted 5 lines
crypto/anubis.c 2011-02-25 23:07:12.000000000 +0530 renamed from crypto/anubis.c 2011-02-25 04:39:00.000000000 +0530 +1 -1
@@ -578,7 +578,7 @@ static void anubis_crypt(u32 roundKey[AN
        __be32 *dst = (__be32 *)ciphertext;
        int i, r;
        u32 state[4];
-       u32 inter[4];
+       u32 inter[4] = { 0, 0, 0, 0 };

That's nice, it looks like a bug in the compiler, preinitializing this variable doesn't fix any real bug.

sorry,

greg k-h