mirror of
https://git.libssh.org/projects/libssh.git
synced 2026-02-04 12:20:42 +09:00
Fix a segfault if a NULL pointer is passed to ssh_disconnect().
This commit is contained in:
@@ -628,13 +628,12 @@ char *ssh_get_issue_banner(SSH_SESSION *session) {
|
||||
void ssh_disconnect(SSH_SESSION *session) {
|
||||
STRING *str = NULL;
|
||||
|
||||
enter_function();
|
||||
|
||||
if (session == NULL) {
|
||||
leave_function();
|
||||
return;
|
||||
}
|
||||
|
||||
enter_function();
|
||||
|
||||
if (ssh_socket_is_open(session->socket)) {
|
||||
if (buffer_add_u8(session->out_buffer, SSH2_MSG_DISCONNECT) < 0) {
|
||||
goto error;
|
||||
|
||||
Reference in New Issue
Block a user