+2005-09-21 Tom Yu <tlyu@mit.edu>
+
+ * inq_cred.c (krb5_gss_inquire_cred): Initialize ret_name to
+ NULL. Only call kg_save_name() if ret_name is actually non-NULL.
+ Return GSS_C_NO_NAME for now if no principal name in the cred.
+ Reported by Christoph Weizen.
+
2005-08-11 Tom Yu <tlyu@mit.edu>
* import_name.c: Include stdio.h regardless of presence of
OM_uint32 ret;
ret = GSS_S_FAILURE;
+ ret_name = NULL;
code = krb5_init_context(&context);
if (code) {
(gss_OID) gss_mech_krb5,
&mechs)))) {
k5_mutex_unlock(&cred->lock);
- krb5_free_principal(context, ret_name);
+ if (ret_name)
+ krb5_free_principal(context, ret_name);
/* *minor_status set above */
goto fail;
}
}
if (name) {
- if (! kg_save_name((gss_name_t) ret_name)) {
+ if (ret_name != NULL && ! kg_save_name((gss_name_t) ret_name)) {
k5_mutex_unlock(&cred->lock);
(void) gss_release_oid_set(minor_status, &mechs);
krb5_free_principal(context, ret_name);
krb5_free_context(context);
return(GSS_S_FAILURE);
}
- *name = (gss_name_t) ret_name;
+ if (ret_name != NULL)
+ *name = (gss_name_t) ret_name;
+ else
+ *name = GSS_C_NO_NAME;
}
if (lifetime_ret)