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

gssapi: Avoid memory leaks of selected OID (GHSL-2023-036)

Thanks Phil Turnbull from GitHub

Signed-off-by: Jakub Jelen <jjelen@redhat.com>
Reviewed-by: Norbert Pocs <npocs@redhat.com>
Reviewed-by: Andreas Schneider <asn@cryptomilk.org>
This commit is contained in:
Jakub Jelen
2023-03-06 12:23:09 +01:00
parent 3c381565c9
commit f73dac8eed

View File

@@ -730,7 +730,7 @@ end:
int ssh_gssapi_auth_mic(ssh_session session)
{
size_t i;
gss_OID_set selected; /* oid selected for authentication */
gss_OID_set selected = GSS_C_NO_OID_SET; /* oid selected for authentication */
ssh_string *oids = NULL;
int rc;
size_t n_oids = 0;
@@ -807,6 +807,8 @@ out:
SSH_STRING_FREE(oids[i]);
}
free(oids);
gss_release_oid_set(&min_stat, &selected);
if (rc != SSH_ERROR) {
return SSH_AUTH_AGAIN;
}