From cb8236c0c92573d4d42a83a87de1dc111085978c Mon Sep 17 00:00:00 2001 From: Tom Yu Date: Sat, 30 Jun 2001 02:57:51 +0000 Subject: [PATCH] * 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. git-svn-id: svn://anonsvn.mit.edu/krb5/trunk@13532 dc483132-0cff-0310-8789-dd5450dbe970 --- src/lib/krb5/krb/ChangeLog | 8 ++++++++ src/lib/krb5/krb/init_ctx.c | 6 ++---- 2 files changed, 10 insertions(+), 4 deletions(-) diff --git a/src/lib/krb5/krb/ChangeLog b/src/lib/krb5/krb/ChangeLog index 3dcbfe663..80fe6978e 100644 --- a/src/lib/krb5/krb/ChangeLog +++ b/src/lib/krb5/krb/ChangeLog @@ -1,3 +1,11 @@ +2001-06-29 Tom Yu + + * 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 * chk_trans.c (foreach_realm): Cleanup loal variable set but never diff --git a/src/lib/krb5/krb/init_ctx.c b/src/lib/krb5/krb/init_ctx.c index e42095106..df0dfe1c9 100644 --- a/src/lib/krb5/krb/init_ctx.c +++ b/src/lib/krb5/krb/init_ctx.c @@ -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; } -- 2.26.2