From bcaab7be8b2fdb5b8ff768ecb20fba227e6bba69 Mon Sep 17 00:00:00 2001 From: Ken Raeburn Date: Tue, 1 Apr 2003 22:57:53 +0000 Subject: [PATCH] * unparse.c (krb5_unparse_name_ext): Don't move buffer pointer backwards if nothing has been put into the buffer yet. ticket: 1397 git-svn-id: svn://anonsvn.mit.edu/krb5/trunk@15314 dc483132-0cff-0310-8789-dd5450dbe970 --- src/lib/krb5/krb/ChangeLog | 3 +++ src/lib/krb5/krb/unparse.c | 3 ++- 2 files changed, 5 insertions(+), 1 deletion(-) diff --git a/src/lib/krb5/krb/ChangeLog b/src/lib/krb5/krb/ChangeLog index 59ab6802d..e70c3b6f6 100644 --- a/src/lib/krb5/krb/ChangeLog +++ b/src/lib/krb5/krb/ChangeLog @@ -9,6 +9,9 @@ * srv_rcache.c (krb5_get_server_rcache): Check for null pointer supplied in place of name. + * unparse.c (krb5_unparse_name_ext): Don't move buffer pointer + backwards if nothing has been put into the buffer yet. + 2003-04-01 Sam Hartman * rd_req.c (krb5_rd_req): If AUTH_CONTEXT_DO_TIME is cleared, diff --git a/src/lib/krb5/krb/unparse.c b/src/lib/krb5/krb/unparse.c index f0e52dcee..6f1a3c9e8 100644 --- a/src/lib/krb5/krb/unparse.c +++ b/src/lib/krb5/krb/unparse.c @@ -149,7 +149,8 @@ krb5_unparse_name_ext(krb5_context context, krb5_const_principal principal, regi *q++ = COMPONENT_SEP; } - q--; /* Back up last component separator */ + if (i > 0) + q--; /* Back up last component separator */ *q++ = REALM_SEP; cp = krb5_princ_realm(context, principal)->data; -- 2.26.2