1
0
mirror of https://git.libssh.org/projects/libssh.git synced 2025-08-10 06:23:01 +03:00

fix null dereference of error

The Coverity scan CID 1506418 found the null pointer dereferencing

Signed-off-by: Ahsen Kamal <itsahsenkamal@gmail.com>
Reviewed-by: Jakub Jelen <jjelen@redhat.com>
(cherry picked from commit 6d3e7e1c44)
This commit is contained in:
Ahsen Kamal
2023-03-08 22:53:11 +05:30
committed by Jakub Jelen
parent ea639b0258
commit 03f8fcae84

View File

@@ -64,7 +64,9 @@ SSH_PACKET_CALLBACK(ssh_packet_disconnect_callback){
SSH_STRING_FREE(error_s);
}
session->peer_discon_msg = strdup(error);
if (error != NULL) {
session->peer_discon_msg = strdup(error);
}
SSH_LOG(SSH_LOG_PACKET, "Received SSH_MSG_DISCONNECT %d:%s",
code, error != NULL ? error : "no error");