diff options
author | Theodore Tso <tytso@mit.edu> | 1999-03-08 19:45:10 +0000 |
---|---|---|
committer | Theodore Tso <tytso@mit.edu> | 1999-03-08 19:45:10 +0000 |
commit | dd6376bbd15a0d124003d1b1f0ac51410704b445 (patch) | |
tree | c9fd3c68fd4822eaf8643550b16280b7c81270f9 /src/util/profile | |
parent | be95b52c2d0c21b1fe92f9f90166fc2fa8eecc95 (diff) | |
download | krb5-dd6376bbd15a0d124003d1b1f0ac51410704b445.zip krb5-dd6376bbd15a0d124003d1b1f0ac51410704b445.tar.gz krb5-dd6376bbd15a0d124003d1b1f0ac51410704b445.tar.bz2 |
* prof_tree.c (profile_node_iterator): Fix bug where it will loop
endlessly when searching an empty section.
* test_profile.c: Add code so that the "add" code will interpret
"NULL" as calling profile_add_relation with a null pointer
for the value.
git-svn-id: svn://anonsvn.mit.edu/krb5/trunk@11245 dc483132-0cff-0310-8789-dd5450dbe970
Diffstat (limited to 'src/util/profile')
-rw-r--r-- | src/util/profile/ChangeLog | 9 | ||||
-rw-r--r-- | src/util/profile/prof_tree.c | 4 | ||||
-rw-r--r-- | src/util/profile/test_profile.c | 5 |
3 files changed, 15 insertions, 3 deletions
diff --git a/src/util/profile/ChangeLog b/src/util/profile/ChangeLog index 835a00b..bd0dc61 100644 --- a/src/util/profile/ChangeLog +++ b/src/util/profile/ChangeLog @@ -1,3 +1,12 @@ +Mon Mar 8 14:38:24 1999 Theodore Y. Ts'o <tytso@mit.edu> + + * prof_tree.c (profile_node_iterator): Fix bug where it will loop + endlessly when searching an empty section. + + * test_profile.c: Add code so that the "add" code will interpret + "NULL" as calling profile_add_relation with a null pointer + for the value. + Wed Mar 3 18:23:47 1999 Theodore Y. Ts'o <tytso@mit.edu> * prof_file.c (profile_flush_file): On the Macintosh, fopen() diff --git a/src/util/profile/prof_tree.c b/src/util/profile/prof_tree.c index 4716090..77018bb 100644 --- a/src/util/profile/prof_tree.c +++ b/src/util/profile/prof_tree.c @@ -476,7 +476,7 @@ errcode_t profile_node_iterator(iter_p, ret_node, ret_name, ret_value) iter->node = 0; } get_new_file: - while (iter->node == 0) { + if (iter->node == 0) { if (iter->file == 0 || (iter->flags & PROFILE_ITER_FINAL_SEEN)) { profile_node_iterator_free(iter_p); @@ -513,7 +513,7 @@ get_new_file: if (!section) { iter->file = iter->file->next; skip_num = 0; - continue; + goto get_new_file; } iter->name = *cpp; iter->node = section->first_child; diff --git a/src/util/profile/test_profile.c b/src/util/profile/test_profile.c index a36b778..da81a20 100644 --- a/src/util/profile/test_profile.c +++ b/src/util/profile/test_profile.c @@ -83,8 +83,11 @@ static void do_batchmode(profile) retval = profile_rename_section(profile, names+1, *names); } else if (!strcmp(cmd, "add")) { + value = *names; + if (strcmp(value, "NULL") == 0) + value = NULL; retval = profile_add_relation(profile, names+1, - *names); + value); } else if (!strcmp(cmd, "flush")) { retval = profile_flush(profile); } else { |