]> git.ipfire.org Git - thirdparty/krb5.git/commitdiff
Check public_oid in gss_export_cred() 828/head
authorGreg Hudson <ghudson@mit.edu>
Fri, 10 Aug 2018 15:58:11 +0000 (11:58 -0400)
committerGreg Hudson <ghudson@mit.edu>
Mon, 13 Aug 2018 21:18:06 +0000 (17:18 -0400)
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.

src/lib/gssapi/mechglue/g_export_cred.c

index 8f5fe4ad5a2bd65b9ee4e5931f4c8be23c45d4f4..0c273bf14ed9cbcee60eefb7ef23763f2a23caf4 100644 (file)
@@ -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;
         }