Skip Menu |
 

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);

From: tlyu@mit.edu
Subject: SVN Commit

Adapted patch from Arlene Berry to handle dlerror() returning a null
pointer.

https://github.com/krb5/krb5/commit/08eec8918ad086d2b9bd612fb1c90b62d298ec0a
Commit By: tlyu
Revision: 23929
Changed Files:
U trunk/src/util/support/plugins.c
From: tlyu@mit.edu
Subject: SVN Commit

pull up r23929 from trunk

------------------------------------------------------------------------
r23929 | tlyu | 2010-04-22 21:30:48 -0400 (Thu, 22 Apr 2010) | 7 lines

ticket: 6697
target_version: 1.8.2
tags: pullup

Adapted patch from Arlene Berry to handle dlerror() returning a null
pointer.

https://github.com/krb5/krb5/commit/83e30ba0f4d111a1b64b079ac7b8bb481c2e6b21
Commit By: tlyu
Revision: 24058
Changed Files:
U branches/krb5-1-8/src/util/support/plugins.c