mirror of
https://git.libssh.org/projects/libssh.git
synced 2026-01-06 14:21:55 +03:00
Fix a segfault if a NULL pointer is passed to ssh_disconnect().
This commit is contained in:
@@ -623,13 +623,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