aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorAndreas Schneider <asn@cryptomilk.org>2018-01-18 18:55:52 +0100
committerAndreas Schneider <asn@cryptomilk.org>2018-01-18 18:55:52 +0100
commitd7c47f529f2f5d6d032fc279c7fe078745e0ac44 (patch)
tree484d3d9700f85b98dc7ef343520058c314033b49 /src
parent2cff66c15577ec921bd217fbe99e6e53e29b0acb (diff)
downloadlibssh-d7c47f529f2f5d6d032fc279c7fe078745e0ac44.tar.gz
libssh-d7c47f529f2f5d6d032fc279c7fe078745e0ac44.tar.xz
libssh-d7c47f529f2f5d6d032fc279c7fe078745e0ac44.zip
pki_gcrypt: Use calloc() instead of malloc()
Signed-off-by: Andreas Schneider <asn@cryptomilk.org>
Diffstat (limited to 'src')
-rw-r--r--src/pki_gcrypt.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/src/pki_gcrypt.c b/src/pki_gcrypt.c
index 025ff1b9..713c035f 100644
--- a/src/pki_gcrypt.c
+++ b/src/pki_gcrypt.c
@@ -314,7 +314,7 @@ static int privatekey_decrypt(int algo, int mode, unsigned int key_len,
if (gcry_cipher_open(&cipher, algo, mode, 0)
|| gcry_cipher_setkey(cipher, key, key_len)
|| gcry_cipher_setiv(cipher, iv, iv_len)
- || (tmp = malloc(ssh_buffer_get_len(data) * sizeof (char))) == NULL
+ || (tmp = calloc(ssh_buffer_get_len(data), sizeof(char))) == NULL
|| gcry_cipher_decrypt(cipher, tmp, ssh_buffer_get_len(data),
ssh_buffer_get(data), ssh_buffer_get_len(data))) {
gcry_cipher_close(cipher);