From 22e3a79c4a67cfc3e4d7eb628ce84aa0497a061e Mon Sep 17 00:00:00 2001 From: Kevin Coffman Date: Tue, 10 Oct 2006 20:52:34 +0000 Subject: [PATCH] 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 --- src/kdc/kdc_preauth.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) 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) { -- 2.26.2