From: Greg Hudson Date: Wed, 15 Sep 2010 15:50:15 +0000 (+0000) Subject: In krb5_sname_to_principal, correctly handle failures from X-Git-Tag: krb5-1.9-beta1~98 X-Git-Url: http://git.tremily.us/?a=commitdiff_plain;h=073c9305ed0eff74c06ed8fd1b950fd47828d1e5;p=krb5.git In krb5_sname_to_principal, correctly handle failures from krb5_build_principal. ticket: 6777 git-svn-id: svn://anonsvn.mit.edu/krb5/trunk@24309 dc483132-0cff-0310-8789-dd5450dbe970 --- diff --git a/src/lib/krb5/os/sn2princ.c b/src/lib/krb5/os/sn2princ.c index 8bd823090..9645fef37 100644 --- a/src/lib/krb5/os/sn2princ.c +++ b/src/lib/krb5/os/sn2princ.c @@ -196,8 +196,8 @@ krb5_sname_to_principal(krb5_context context, const char *hostname, const char * retval = krb5_build_principal(context, ret_princ, strlen(realm), realm, sname, remote_host, (char *)0); - - krb5_princ_type(context, *ret_princ) = type; + if (retval == 0) + krb5_princ_type(context, *ret_princ) = type; #ifdef DEBUG_REFERRALS printf("krb5_sname_to_principal returning\n");