mirror of
https://git.libssh.org/projects/libssh.git
synced 2026-02-04 20:30:38 +09:00
auth: Avoid forward-null pointer dereference
This could happen only if the function would really be called with the NULL session, but this was never the case as the session is dereferenced already on all code paths toward this place. This is just to make the scanner happy that the session can not really be NULL here. Thanks coverity! CID 1593926 Signed-off-by: Jakub Jelen <jjelen@redhat.com> Reviewed-by: Norbert Pocs <norbertpocs0@gmail.com>
This commit is contained in:
@@ -480,7 +480,11 @@ static int add_hostbound_pubkey(ssh_session session)
|
||||
int rc;
|
||||
ssh_string server_pubkey_s = NULL;
|
||||
|
||||
if (session == NULL || session->current_crypto == NULL ||
|
||||
if (session == NULL) {
|
||||
return SSH_ERROR;
|
||||
}
|
||||
|
||||
if (session->current_crypto == NULL ||
|
||||
session->current_crypto->server_pubkey == NULL) {
|
||||
ssh_set_error(session,
|
||||
SSH_FATAL,
|
||||
|
||||
Reference in New Issue
Block a user