mirror of
https://git.libssh.org/projects/libssh.git
synced 2026-02-04 12:20:42 +09:00
do not segfault in ssh_bind_accept if bindaddr is NULL
Signed-off-by: Andreas Schneider <mail@cynapses.org>
This commit is contained in:
committed by
Andreas Schneider
parent
ff52e3630f
commit
bf376b6d4f
@@ -251,12 +251,16 @@ ssh_session ssh_bind_accept(SSH_BIND *sshbind) {
|
||||
}
|
||||
}
|
||||
|
||||
session->bindaddr = strdup(sshbind->bindaddr);
|
||||
if (session->bindaddr == NULL) {
|
||||
privatekey_free(dsa);
|
||||
privatekey_free(rsa);
|
||||
ssh_cleanup(session);
|
||||
return NULL;
|
||||
if (sshbind->bindaddr == NULL)
|
||||
session->bindaddr = NULL;
|
||||
else {
|
||||
session->bindaddr = strdup(sshbind->bindaddr);
|
||||
if (session->bindaddr == NULL) {
|
||||
privatekey_free(dsa);
|
||||
privatekey_free(rsa);
|
||||
ssh_cleanup(session);
|
||||
return NULL;
|
||||
}
|
||||
}
|
||||
|
||||
ssh_socket_free(session->socket);
|
||||
|
||||
Reference in New Issue
Block a user