* unparse.c (krb5_unparse_name_ext): Don't move buffer pointer backwards if
authorKen Raeburn <raeburn@mit.edu>
Tue, 1 Apr 2003 22:57:53 +0000 (22:57 +0000)
committerKen Raeburn <raeburn@mit.edu>
Tue, 1 Apr 2003 22:57:53 +0000 (22:57 +0000)
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
src/lib/krb5/krb/unparse.c

index 59ab6802da7a13a164d2d1bab913786d5c341791..e70c3b6f6aaa67321e855b60bfba189e04c45c5b 100644 (file)
@@ -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  <hartmans@mit.edu>
 
        * rd_req.c (krb5_rd_req): If AUTH_CONTEXT_DO_TIME is cleared,
index f0e52dceee7223437a0449a9032e14b625fc46ab..6f1a3c9e8b24ae8f6ec804b21d4fc1ca563d503d 100644 (file)
@@ -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;