From aef0af3adadc2801786e286817628a7ac6801de7 Mon Sep 17 00:00:00 2001 From: Theodore Tso Date: Fri, 5 May 1995 04:57:03 +0000 Subject: [PATCH] prof_init.c (profile_get_values): Return PROF_NO_PROFILE if the passed-in profile variable is NULL (instead of core dumping). prof_err.et (PROF_NO_PROFILE): Defined new error code. git-svn-id: svn://anonsvn.mit.edu/krb5/trunk@5727 dc483132-0cff-0310-8789-dd5450dbe970 --- src/util/profile/ChangeLog | 7 +++++++ src/util/profile/prof_err.et | 1 + src/util/profile/prof_init.c | 3 +++ 3 files changed, 11 insertions(+) diff --git a/src/util/profile/ChangeLog b/src/util/profile/ChangeLog index 3bf2b274f..086c07a26 100644 --- a/src/util/profile/ChangeLog +++ b/src/util/profile/ChangeLog @@ -1,3 +1,10 @@ +Fri May 5 00:02:41 1995 Theodore Y. Ts'o (tytso@dcl) + + * prof_init.c (profile_get_values): Return PROF_NO_PROFILE if the + passed-in profile variable is NULL (instead of core dumping). + + * prof_err.et (PROF_NO_PROFILE): Defined new error code. + Thu May 4 23:57:56 1995 Theodore Y. Ts'o (tytso@dcl) * prof_tree.c (profile_free_node): Copy child->next to a scratch diff --git a/src/util/profile/prof_err.et b/src/util/profile/prof_err.et index 8686829e6..311570a7f 100644 --- a/src/util/profile/prof_err.et +++ b/src/util/profile/prof_err.et @@ -37,5 +37,6 @@ error_code PROF_TOPSECTION_ITER_NOSUPP, error_code PROF_INVALID_SECTION, "Invalid profile_section object" error_code PROF_END_OF_SECTIONS, "No more sections" error_code PROF_BAD_NAMESET, "Bad nameset passed to query routine" +error_code PROF_NO_PROFILE, "No profile file open" end diff --git a/src/util/profile/prof_init.c b/src/util/profile/prof_init.c index 57af950fb..5dcc84e53 100644 --- a/src/util/profile/prof_init.c +++ b/src/util/profile/prof_init.c @@ -126,6 +126,9 @@ errcode_t profile_get_values(profile, names, ret_values) struct string_list values; const char **cpp; + if (profile == 0) + return PROF_NO_PROFILE; + if (names == 0 || names[0] == 0 || names[1] == 0) return PROF_BAD_NAMESET; -- 2.26.2