Subject: | segfault caused by dlerror returning NULL |
Date: | Fri, 9 Apr 2010 19:14:11 -0400 |
From: | "Arlene Berry" <aberry@likewise.com> |
To: | <krb5-bugs@mit.edu> |
We experienced a segfault due to dlerror returning NULL. We suspect it was due to our application being multi-threaded. We made the change below to fix it. However, there is a second use of dlerror in the same file that should probably be fixed as well.
Index: src/linux/krb5/src/util/support/plugins.c
===================================================================
--- src/linux/krb5/src/util/support/plugins.c (revision 43141)
+++ src/linux/krb5/src/util/support/plugins.c (revision 43142)
@@ -267,6 +267,10 @@
handle = dlopen(filepath, PLUGIN_DLOPEN_FLAGS);
if (handle == NULL) {
const char *e = dlerror();
+ if (e == NULL)
+ {
+ e = "";
+ }
Tprintf ("dlopen(%s): %s\n", filepath, e);
err = ENOENT; /* XXX */
krb5int_set_error (ep, err, "%s", e);