mirror of
https://git.libssh.org/projects/libssh.git
synced 2026-02-04 12:20:42 +09:00
wrapper: Avoid memory leak on errors during key exchange
As reported by oss-fuzz
https://bugs.chromium.org/p/oss-fuzz/issues/detail?id=28075
Signed-off-by: Jakub Jelen <jjelen@redhat.com>
Reviewed-by: Andreas Schneider <asn@cryptomilk.org>
(cherry picked from commit 9c6404aa49)
This commit is contained in:
@@ -182,6 +182,7 @@ void crypto_free(struct ssh_crypto_struct *crypto)
|
||||
crypto->ecdh_privkey = NULL;
|
||||
}
|
||||
#endif
|
||||
SAFE_FREE(crypto->dh_server_signature);
|
||||
if (crypto->session_id != NULL) {
|
||||
explicit_bzero(crypto->session_id, crypto->digest_len);
|
||||
SAFE_FREE(crypto->session_id);
|
||||
|
||||
Reference in New Issue
Block a user