From: Tom Yu Date: Wed, 22 Feb 2012 04:11:45 +0000 (+0000) Subject: Pull up r25674 from trunk X-Git-Tag: krb5-1.10.1-final~11 X-Git-Url: http://git.tremily.us/?a=commitdiff_plain;h=ee7187c23249334e66d810c9e0a388a0518e0729;p=krb5.git Pull up r25674 from trunk ------------------------------------------------------------------------ r25674 | ghudson | 2012-02-06 18:19:08 -0500 (Mon, 06 Feb 2012) | 18 lines ticket: 7087 status: open target_version: 1.10.1 tags: pullup Set display_value in krb5_gss_get_name_attribute A backwards conditional in r25358 caused krb5_gss_get_name_attribute not to set display_value on success. Fix the sense of the conditional. We still don't quite correctly handle the cases where data_to_gss() fails, but those should be rare and the problem in those cases isn't severe, so it can be fixed separately. Also, value and display_value should probably be initialized to null buffers on failure, as is common with GSS interfaces. ticket: 7087 version_fixed: 1.10.1 status: resolved git-svn-id: svn://anonsvn.mit.edu/krb5/branches/krb5-1-10@25707 dc483132-0cff-0310-8789-dd5450dbe970 --- diff --git a/src/lib/gssapi/krb5/naming_exts.c b/src/lib/gssapi/krb5/naming_exts.c index 725d801dd..f48b1cbbf 100644 --- a/src/lib/gssapi/krb5/naming_exts.c +++ b/src/lib/gssapi/krb5/naming_exts.c @@ -387,7 +387,7 @@ krb5_gss_get_name_attribute(OM_uint32 *minor_status, *complete = kcomplete; if (display_value != NULL) { - if (code != 0) + if (code == 0) code = data_to_gss(&kdisplay_value, display_value); else free(kdisplay_value.data);