mirror of
https://git.libssh.org/projects/libssh.git
synced 2025-11-27 13:21:11 +03:00
pki_gcrypt: Use calloc() instead of malloc()
Signed-off-by: Andreas Schneider <asn@cryptomilk.org>
This commit is contained in:
@@ -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);
|
||||
|
||||
Reference in New Issue
Block a user