krb5 commit: Check public_oid in gss_export_cred()

Greg Hudson <[email protected]>
Newsgroups gmane.comp.encryption.kerberos.cvs
Message-ID <[email protected]>
https://github.com/krb5/krb5/commit/93de356ec21857dc9e7070ee62997fa8ec3f82c3
commit 93de356ec21857dc9e7070ee62997fa8ec3f82c3
Author: Greg Hudson <[email protected]>
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;
         }
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.