From 073c9305ed0eff74c06ed8fd1b950fd47828d1e5 Mon Sep 17 00:00:00 2001 From: Greg Hudson Date: Wed, 15 Sep 2010 15:50:15 +0000 Subject: [PATCH] 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 --- src/lib/krb5/os/sn2princ.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) 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"); -- 2.26.2