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:
Jakub Jelen
2025-03-20 15:24:11 +01:00
parent cce600f980
commit 1434f24911

View File

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