1
0
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:
Andreas Schneider
2009-07-22 16:04:41 +02:00
parent 3cd06a1f26
commit 85a5eb9499

View File

@@ -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;