1
0
mirror of https://git.libssh.org/projects/libssh.git synced 2025-05-31 16:21:13 +03:00

packet_crypt: Make sure we always operate on initilized memory

Found by MemorySanitizer.

Signed-off-by: Andreas Schneider <asn@cryptomilk.org>
This commit is contained in:
Andreas Schneider 2019-01-25 16:06:20 +01:00
parent 932102bd13
commit d598e4e52a

View File

@ -150,7 +150,7 @@ unsigned char *ssh_packet_encrypt(ssh_session session, void *data, uint32_t len)
" on at least one blocksize (received %d)", len); " on at least one blocksize (received %d)", len);
return NULL; return NULL;
} }
out = malloc(len); out = calloc(1, len);
if (out == NULL) { if (out == NULL) {
return NULL; return NULL;
} }