Module: kamailio
Branch: master
Commit: a972c3bd5287177f8fa73dfb0ed5b2da8e3f4f57
URL:
https://github.com/kamailio/kamailio/commit/a972c3bd5287177f8fa73dfb0ed5b2d…
Author: Daniel-Constantin Mierla <miconda(a)gmail.com>
Committer: Daniel-Constantin Mierla <miconda(a)gmail.com>
Date: 2024-01-18T18:37:41+01:00
gcrypt: init allocated buffer
---
Modified: src/modules/gcrypt/gcrypt_mod.c
---
Diff:
https://github.com/kamailio/kamailio/commit/a972c3bd5287177f8fa73dfb0ed5b2d…
Patch:
https://github.com/kamailio/kamailio/commit/a972c3bd5287177f8fa73dfb0ed5b2d…
---
diff --git a/src/modules/gcrypt/gcrypt_mod.c b/src/modules/gcrypt/gcrypt_mod.c
index 8a5550139c8..69be4432535 100644
--- a/src/modules/gcrypt/gcrypt_mod.c
+++ b/src/modules/gcrypt/gcrypt_mod.c
@@ -183,6 +183,7 @@ static int ki_gcrypt_aes_encrypt_helper(
SYS_MEM_ERROR;
goto error;
}
+ encypted_txt[0] = '\0';
gcry_ret = gcry_cipher_encrypt(cipher_hd, // gcry_cipher_hd_t h
encypted_txt, // unsigned char *out
ins->len, // size_t outsize
@@ -349,6 +350,7 @@ static int ki_gcrypt_aes_decrypt_helper(
SYS_MEM_ERROR;
goto error;
}
+ decrypted_txt[0] = '\0';
gcry_ret = gcry_cipher_decrypt(cipher_hd, // gcry_cipher_hd_t h
decrypted_txt, // unsigned char *out
etext.len, // size_t outsize