diff options
Diffstat (limited to 'src/lib')
| -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 cf4127b1d..7107c50f2 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 82bcf8f32..67f03e02f 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; |
