krb5 commit: Check public_oid in gss_export_cred()

Greg Hudson ghudson at mit.edu
Mon Aug 13 17:46:19 EDT 2018


https://github.com/krb5/krb5/commit/93de356ec21857dc9e7070ee62997fa8ec3f82c3
commit 93de356ec21857dc9e7070ee62997fa8ec3f82c3
Author: Greg Hudson <ghudson at mit.edu>
Date:   Fri Aug 10 11:58:11 2018 -0400

    Check public_oid in gss_export_cred()
    
    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 |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)

diff --git a/src/lib/gssapi/mechglue/g_export_cred.c b/src/lib/gssapi/mechglue/g_export_cred.c
index 8f5fe4a..0c273bf 100644
--- a/src/lib/gssapi/mechglue/g_export_cred.c
+++ b/src/lib/gssapi/mechglue/g_export_cred.c
@@ -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;
         }


More information about the cvs-krb5 mailing list