Check mech_type as well as mech_name in gssint_import_internal_name(),
authorGreg Hudson <ghudson@mit.edu>
Sat, 16 Apr 2011 17:30:38 +0000 (17:30 +0000)
committerGreg Hudson <ghudson@mit.edu>
Sat, 16 Apr 2011 17:30:38 +0000 (17:30 +0000)
for the sake of static analyzers.  (Also, since this is an internal
function, it can be called on a half-constructed MN; checking the type
alone would be insufficient.)

git-svn-id: svn://anonsvn.mit.edu/krb5/trunk@24884 dc483132-0cff-0310-8789-dd5450dbe970

src/lib/gssapi/mechglue/g_glue.c

index 1dcd14795238eaf16f722db38ecf9764ca42f08e..90febd5b9b6b56f98e29701a0e6db0956ae34ac0 100644 (file)
@@ -367,7 +367,8 @@ gss_name_t  *internal_name;
      * If we are importing a name for the same mechanism, and the
      * mechanism implements gss_duplicate_name, then use that.
      */
-    if (union_name->mech_name != GSS_C_NO_NAME &&
+    if (union_name->mech_type != GSS_C_NO_OID &&
+       union_name->mech_name != GSS_C_NO_NAME &&
        g_OID_equal(union_name->mech_type, mech_type) &&
        mech->gss_duplicate_name != NULL) {
        status = mech->gss_duplicate_name(minor_status,