Skip to content

Commit

Permalink
Check public_oid in gss_export_cred()
Browse files Browse the repository at this point in the history
In gss_export_cred(), check the gssint_get_public_oid() result as well
as the gssint_get_mechanism() result.  There are probably no cases
where the former returns NULL and the latter does not, but it is easy
to be more obviously correct.  Reported by Bean Zhang.
  • Loading branch information
greghudson committed Aug 13, 2018
1 parent ab91899 commit 93de356
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/lib/gssapi/mechglue/g_export_cred.c
Original file line number Diff line number Diff line change
Expand Up @@ -81,7 +81,7 @@ gss_export_cred(OM_uint32 * minor_status, gss_cred_id_t cred_handle,
mech_oid = &cred->mechs_array[i];
public_oid = gssint_get_public_oid(mech_oid);
mech = gssint_get_mechanism(mech_oid);
if (mech == NULL) {
if (public_oid == GSS_C_NO_OID || mech == NULL) {
status = GSS_S_DEFECTIVE_CREDENTIAL;
goto error;
}
Expand Down

0 comments on commit 93de356

Please sign in to comment.