mirror of
https://git.libssh.org/projects/libssh.git
synced 2026-02-11 18:50:28 +09: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) {
|
void ssh_disconnect(SSH_SESSION *session) {
|
||||||
STRING *str = NULL;
|
STRING *str = NULL;
|
||||||
|
|
||||||
enter_function();
|
|
||||||
|
|
||||||
if (session == NULL) {
|
if (session == NULL) {
|
||||||
leave_function();
|
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
enter_function();
|
||||||
|
|
||||||
if (ssh_socket_is_open(session->socket)) {
|
if (ssh_socket_is_open(session->socket)) {
|
||||||
if (buffer_add_u8(session->out_buffer, SSH2_MSG_DISCONNECT) < 0) {
|
if (buffer_add_u8(session->out_buffer, SSH2_MSG_DISCONNECT) < 0) {
|
||||||
goto error;
|
goto error;
|
||||||
|
|||||||
Reference in New Issue
Block a user