* init_ctx.c (get_profile_etype_list): Fix etype-counting loop so
authorTom Yu <tlyu@mit.edu>
Sat, 30 Jun 2001 02:57:51 +0000 (02:57 +0000)
committerTom Yu <tlyu@mit.edu>
Sat, 30 Jun 2001 02:57:51 +0000 (02:57 +0000)
that trailing separator characters (as in the DEFAULT_ETYPE_LIST)
don't cause another iteration, which was causing the following
loop to fall off the end of the string due to count being one too
great.

git-svn-id: svn://anonsvn.mit.edu/krb5/trunk@13532 dc483132-0cff-0310-8789-dd5450dbe970

src/lib/krb5/krb/ChangeLog
src/lib/krb5/krb/init_ctx.c

index 3dcbfe663555b9bdf90b08c0dd3af8b2b1b88f5e..80fe6978e4a735d50e2be77229d933184523ce75 100644 (file)
@@ -1,3 +1,11 @@
+2001-06-29  Tom Yu  <tlyu@mit.edu>
+
+       * init_ctx.c (get_profile_etype_list): Fix etype-counting loop so
+       that trailing separator characters (as in the DEFAULT_ETYPE_LIST)
+       don't cause another iteration, which was causing the following
+       loop to fall off the end of the string due to count being one too
+       great.
+
 2001-06-28  Ezra Peisach  <epeisach@mit.edu>
 
        * chk_trans.c (foreach_realm): Cleanup loal variable set but never
index e42095106fa97e7bb5e069098fd9771c40ef0fd4..df0dfe1c9536bbcec965f74c339d2e23cf132312 100644 (file)
@@ -332,16 +332,14 @@ get_profile_etype_list(context, ktypes, profstr, ctx_count, ctx_list)
 
        count = 0;
        sp = retval;
-       while (sp) {
+       while (*sp) {
            for (ep = sp; *ep && (*ep != ',') && !isspace((int) (*ep)); ep++)
                ;
            if (*ep) {
                *ep++ = '\0';
                while (isspace((int) (*ep)) || *ep == ',')
                    *ep++ = '\0';
-           } else
-               ep = (char *) NULL;
-
+           }
            count++;
            sp = ep;
        }