summaryrefslogtreecommitdiffstats
path: root/src/kdc/kdc_preauth.c
diff options
context:
space:
mode:
authorKevin Coffman <kwc@citi.umich.edu>2006-10-10 20:52:34 +0000
committerKevin Coffman <kwc@citi.umich.edu>2006-10-10 20:52:34 +0000
commit22e3a79c4a67cfc3e4d7eb628ce84aa0497a061e (patch)
tree35385ec43ada6445653bd65b1bcc7fe350885577 /src/kdc/kdc_preauth.c
parent8cf95742d1527bcfd585cb8d1d565f3ef451b261 (diff)
downloadkrb5-22e3a79c4a67cfc3e4d7eb628ce84aa0497a061e.tar.gz
krb5-22e3a79c4a67cfc3e4d7eb628ce84aa0497a061e.tar.xz
krb5-22e3a79c4a67cfc3e4d7eb628ce84aa0497a061e.zip
Don't segfault if a preauth plugin module fails to load
Move the zeroing of the errinfo struct before the call to krb5int_open_plugin_dirs() to prevent segfault in the case where a plugin fails to load. (For example if there are unresolved symbols.) ticket: new git-svn-id: svn://anonsvn.mit.edu/krb5/trunk@18671 dc483132-0cff-0310-8789-dd5450dbe970
Diffstat (limited to 'src/kdc/kdc_preauth.c')
-rw-r--r--src/kdc/kdc_preauth.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/src/kdc/kdc_preauth.c b/src/kdc/kdc_preauth.c
index 936c9b6f3..93bedf9c0 100644
--- a/src/kdc/kdc_preauth.c
+++ b/src/kdc/kdc_preauth.c
@@ -305,6 +305,8 @@ load_preauth_plugins(krb5_context context)
void *pa_sys_context;
init_proc server_init_proc;
+ memset(&err, 0, sizeof(err));
+
/* Attempt to load all of the preauth plugins we can find. */
PLUGIN_DIR_INIT(&preauth_plugins);
if (PLUGIN_DIR_OPEN(&preauth_plugins) == 0) {
@@ -315,7 +317,6 @@ load_preauth_plugins(krb5_context context)
}
/* Get the method tables provided by the loaded plugins. */
- memset(&err, 0, sizeof(err));
preauth_plugins_ftables = NULL;
if (krb5int_get_plugin_dir_data(&preauth_plugins, "preauthentication0",
&preauth_plugins_ftables, &err) != 0) {