mirror of
https://git.libssh.org/projects/libssh.git
synced 2026-02-10 10:26:47 +09:00
dh: Make sure we do not access uninitialized memory
Signed-off-by: Jakub Jelen <jjelen@redhat.com>
Reviewed-by: Andreas Schneider <asn@cryptomilk.org>
(cherry picked from commit ca62632170)
This commit is contained in:
committed by
Andreas Schneider
parent
68fc17caac
commit
d028b2495d
4
src/dh.c
4
src/dh.c
@@ -1274,6 +1274,10 @@ int ssh_get_server_publickey(ssh_session session, ssh_key *key)
|
|||||||
|
|
||||||
ssh_key ssh_dh_get_current_server_publickey(ssh_session session)
|
ssh_key ssh_dh_get_current_server_publickey(ssh_session session)
|
||||||
{
|
{
|
||||||
|
if (session->current_crypto == NULL) {
|
||||||
|
return NULL;
|
||||||
|
}
|
||||||
|
|
||||||
return session->current_crypto->server_pubkey;
|
return session->current_crypto->server_pubkey;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user