Fix an uninit read in igetest
authorMatt Caswell <matt@openssl.org>
Thu, 4 May 2017 13:47:59 +0000 (14:47 +0100)
committerMatt Caswell <matt@openssl.org>
Thu, 4 May 2017 14:43:25 +0000 (15:43 +0100)
Introduced by commit 0e534337b

Reviewed-by: Rich Salz <rsalz@openssl.org>
(Merged from https://github.com/openssl/openssl/pull/2284)

test/igetest.c

index fc80275..f6972b6 100644 (file)
@@ -362,6 +362,7 @@ static int test_bi_ige_garble1(void)
     unsigned int n;
     size_t matches;
 
+    memcpy(iv, saved_iv, sizeof iv);
     AES_set_encrypt_key(rkey, 8 * sizeof rkey, &key);
     AES_set_encrypt_key(rkey2, 8 * sizeof rkey2, &key2);
     AES_ige_encrypt(plaintext, ciphertext, sizeof plaintext, &key, iv,
@@ -392,6 +393,7 @@ static int test_bi_ige_garble2(void)
     unsigned int n;
     size_t matches;
 
+    memcpy(iv, saved_iv, sizeof iv);
     AES_set_encrypt_key(rkey, 8 * sizeof rkey, &key);
     AES_set_encrypt_key(rkey2, 8 * sizeof rkey2, &key2);
     AES_ige_encrypt(plaintext, ciphertext, sizeof plaintext, &key, iv,
@@ -422,6 +424,7 @@ static int test_bi_ige_garble3(void)
     unsigned int n;
     size_t matches;
 
+    memcpy(iv, saved_iv, sizeof iv);
     AES_set_encrypt_key(rkey, 8 * sizeof rkey, &key);
     AES_set_encrypt_key(rkey2, 8 * sizeof rkey2, &key2);
     AES_ige_encrypt(plaintext, ciphertext, sizeof plaintext, &key, iv,