From: Ralf Wildenhues Date: Fri, 1 Oct 2004 02:55:50 +0000 (+0000) Subject: * libltdl/ltdl.c (try_dlopen): Fix null pointer dereference in X-Git-Tag: release-1-9d~14 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=228e9808f8ae110179098e4b4eab6a1a867c84e2;p=thirdparty%2Flibtool.git * libltdl/ltdl.c (try_dlopen): Fix null pointer dereference in case the name given to lt_dlopen contains no extension. --- diff --git a/ChangeLog b/ChangeLog index 47fb87ee2..e3270dc4d 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,5 +1,8 @@ 2004-09-30 Ralf Wildenhues + * libltdl/ltdl.c (try_dlopen): Fix null pointer dereference in + case the name given to lt_dlopen contains no extension. + * libltdl/lt_dlloader.c (lt_dlloader_remove), libltdl/ltdl.c (tryall_dlopen, lt_dlhandle_next): Show usage of function pointers. diff --git a/libltdl/ltdl.c b/libltdl/ltdl.c index 8600b1006..5c2bc9b61 100644 --- a/libltdl/ltdl.c +++ b/libltdl/ltdl.c @@ -986,6 +986,10 @@ try_dlopen (lt_dlhandle *phandle, const char *filename) assert (base_name && *base_name); ext = strrchr (base_name, '.'); + if (!ext) + { + ext = base_name + LT_STRLEN (base_name); + } /* extract the module name from the file name */ name = MALLOC (char, ext - base_name + 1);