gssapi: Sanitize input parameters

Originally reported with this patch by Brian Carpenter from Deep Fork Cyber.

Signed-off-by: Jakub Jelen <jjelen@redhat.com>
Reviewed-by: Pavol Žáčik <pzacik@redhat.com>
This commit is contained in:
Jakub Jelen
2026-01-21 11:33:37 +01:00
parent b2abcf8534
commit a189c2ef4d

View File

@@ -850,6 +850,10 @@ int ssh_gssapi_client_identity(ssh_session session, gss_OID_set *valid_oids)
char *ptr = NULL; char *ptr = NULL;
int ret; int ret;
if (session == NULL || session->gssapi == NULL) {
return SSH_ERROR;
}
if (session->gssapi->client.client_deleg_creds == NULL) { if (session->gssapi->client.client_deleg_creds == NULL) {
if (session->opts.gss_client_identity != NULL) { if (session->opts.gss_client_identity != NULL) {
namebuf.value = (void *)session->opts.gss_client_identity; namebuf.value = (void *)session->opts.gss_client_identity;