[sr-dev] git:master:36abe25e: crypto: fix use of uninitialized values introduced by b08fd55ddd598115a3b69afc630403a582d239f2

Daniel-Constantin Mierla miconda at gmail.com
Mon Apr 5 17:15:53 CEST 2021


Module: kamailio
Branch: master
Commit: 36abe25e35d1862468999bedcaf8bba29ec5f48a
URL: https://github.com/kamailio/kamailio/commit/36abe25e35d1862468999bedcaf8bba29ec5f48a

Author: Daniel-Constantin Mierla <miconda at gmail.com>
Committer: Daniel-Constantin Mierla <miconda at gmail.com>
Date: 2021-04-05T17:10:24+02:00

crypto: fix use of uninitialized values introduced by b08fd55ddd598115a3b69afc630403a582d239f2

---

Modified: src/modules/crypto/crypto_mod.c

---

Diff:  https://github.com/kamailio/kamailio/commit/36abe25e35d1862468999bedcaf8bba29ec5f48a.diff
Patch: https://github.com/kamailio/kamailio/commit/36abe25e35d1862468999bedcaf8bba29ec5f48a.patch

---

diff --git a/src/modules/crypto/crypto_mod.c b/src/modules/crypto/crypto_mod.c
index 5ec753d602..955bf264bf 100644
--- a/src/modules/crypto/crypto_mod.c
+++ b/src/modules/crypto/crypto_mod.c
@@ -192,7 +192,8 @@ static int ki_crypto_aes_encrypt_helper(sip_msg_t* msg, str *ins, str *keys,
 {
 	pv_value_t val;
 	EVP_CIPHER_CTX *en = NULL;
-	str etext, lkey, iv, ttext;
+	str etext, lkey, ttext;
+	str iv = STR_NULL;
 	unsigned char decoded_key[64];
 	unsigned char decoded_iv[16], tmpiv[16];
 
@@ -476,7 +477,7 @@ static int ki_crypto_aes_decrypt_helper(sip_msg_t* msg, str *ins, str *keys,
 	EVP_CIPHER_CTX *de=NULL;
 	str etext, lkey;
 	unsigned char decoded_key[64];
-	char *iv;
+	char *iv = NULL;
 
 	de = EVP_CIPHER_CTX_new();
 	if(de==NULL) {




More information about the sr-dev mailing list