diff options
author | Ken Raeburn <raeburn@mit.edu> | 2005-10-04 20:27:33 +0000 |
---|---|---|
committer | Ken Raeburn <raeburn@mit.edu> | 2005-10-04 20:27:33 +0000 |
commit | b592dede6b1c04c0da2cd326a0f5ef163931876a (patch) | |
tree | e3224940ca5acf14b2913030473a7adbefd035ce /src | |
parent | 5a825c5619994246ed94127b57acd9d823ec8762 (diff) | |
download | krb5-b592dede6b1c04c0da2cd326a0f5ef163931876a.tar.gz krb5-b592dede6b1c04c0da2cd326a0f5ef163931876a.tar.xz krb5-b592dede6b1c04c0da2cd326a0f5ef163931876a.zip |
* kdb5.c (kdb_get_conf_section): If the default realm is null, return null.
(krb5_db_open): Don't pass null pointer to sprintf if default_realm is null.
git-svn-id: svn://anonsvn.mit.edu/krb5/trunk@17402 dc483132-0cff-0310-8789-dd5450dbe970
Diffstat (limited to 'src')
-rw-r--r-- | src/lib/kdb/ChangeLog | 7 | ||||
-rw-r--r-- | src/lib/kdb/kdb5.c | 7 |
2 files changed, 12 insertions, 2 deletions
diff --git a/src/lib/kdb/ChangeLog b/src/lib/kdb/ChangeLog index cf4127b1d1..7107c50f2a 100644 --- a/src/lib/kdb/ChangeLog +++ b/src/lib/kdb/ChangeLog @@ -1,3 +1,10 @@ +2005-10-04 Ken Raeburn <raeburn@mit.edu> + + * kdb5.c (kdb_get_conf_section): If the default realm is null, + return null. + (krb5_db_open): Don't pass null pointer to sprintf if + default_realm is null. + 2005-09-22 Ken Raeburn <raeburn@mit.edu> * kdb_db2: Directory moved to modules/kdb/db2. diff --git a/src/lib/kdb/kdb5.c b/src/lib/kdb/kdb5.c index 82bcf8f32f..67f03e02f7 100644 --- a/src/lib/kdb/kdb5.c +++ b/src/lib/kdb/kdb5.c @@ -171,7 +171,10 @@ kdb_get_conf_section(krb5_context kcontext) char *result = NULL; char *value = NULL; - /* profile has to be initialized. If profile is not initialized, expect nothing less than a crash */ + if (kcontext->default_realm == NULL) + return NULL; + /* The profile has to have been initialized. If the profile was + not initialized, expect nothing less than a crash. */ status = profile_get_string(kcontext->profile, /* realms */ KDB_REALM_SECTION, @@ -638,7 +641,7 @@ krb5_db_open(krb5_context kcontext, char **db_args, int mode) if (section == NULL) { sprintf(buf, "unable to determine configuration section for realm %s\n", - kcontext->default_realm); + kcontext->default_realm ? kcontext->default_realm : "[UNSET]"); status = -1; krb5_set_err(kcontext, krb5_err_have_str, status, buf); goto clean_n_exit; |