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:
@@ -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");
|
||||
|
Reference in New Issue
Block a user