From: Greg Hudson Date: Wed, 20 Jul 2011 22:40:46 +0000 (+0000) Subject: Fix name initialization in gss_krb5int_import_cred X-Git-Tag: krb5-1.10-alpha1~345 X-Git-Url: http://git.tremily.us/?a=commitdiff_plain;h=057760c30b21a93819abc464113c9d64dd8cfb87;p=krb5.git Fix name initialization in gss_krb5int_import_cred If we're going to fake up a name, we have to initialize its lock. It might be better to use kg_init_name(), but we don't have a context on hand. git-svn-id: svn://anonsvn.mit.edu/krb5/trunk@25030 dc483132-0cff-0310-8789-dd5450dbe970 --- diff --git a/src/lib/gssapi/krb5/acquire_cred.c b/src/lib/gssapi/krb5/acquire_cred.c index ca5438bc1..df029cc32 100644 --- a/src/lib/gssapi/krb5/acquire_cred.c +++ b/src/lib/gssapi/krb5/acquire_cred.c @@ -834,6 +834,7 @@ gss_krb5int_import_cred(OM_uint32 *minor_status, struct acquire_cred_args args; krb5_gss_name_rec name; OM_uint32 time_rec; + krb5_error_code code; assert(value->length == sizeof(*req)); @@ -846,6 +847,11 @@ gss_krb5int_import_cred(OM_uint32 *minor_status, if (req->keytab_principal) { memset(&name, 0, sizeof(name)); + code = k5_mutex_init(&name.lock); + if (code != 0) { + *minor_status = code; + return GSS_S_FAILURE; + } name.princ = req->keytab_principal; args.desired_name = (gss_name_t)&name; }