Browse code

crypto: fix use of uninitialized values introduced by b08fd55ddd598115a3b69afc630403a582d239f2

Daniel-Constantin Mierla authored on 05/04/2021 15:10:24
Showing 1 changed files
... ...
@@ -192,7 +192,8 @@ static int ki_crypto_aes_encrypt_helper(sip_msg_t* msg, str *ins, str *keys,
192 192
 {
193 193
 	pv_value_t val;
194 194
 	EVP_CIPHER_CTX *en = NULL;
195
-	str etext, lkey, iv, ttext;
195
+	str etext, lkey, ttext;
196
+	str iv = STR_NULL;
196 197
 	unsigned char decoded_key[64];
197 198
 	unsigned char decoded_iv[16], tmpiv[16];
198 199
 
... ...
@@ -476,7 +477,7 @@ static int ki_crypto_aes_decrypt_helper(sip_msg_t* msg, str *ins, str *keys,
476 477
 	EVP_CIPHER_CTX *de=NULL;
477 478
 	str etext, lkey;
478 479
 	unsigned char decoded_key[64];
479
-	char *iv;
480
+	char *iv = NULL;
480 481
 
481 482
 	de = EVP_CIPHER_CTX_new();
482 483
 	if(de==NULL) {