]> git.ipfire.org Git - thirdparty/libtool.git/commitdiff
* libltdl/ltdl.c (try_dlopen): Fix null pointer dereference in
authorRalf Wildenhues <Ralf.Wildenhues@gmx.de>
Fri, 1 Oct 2004 02:55:50 +0000 (02:55 +0000)
committerGary V. Vaughan <gary@gnu.org>
Fri, 1 Oct 2004 02:55:50 +0000 (02:55 +0000)
case the name given to lt_dlopen contains no extension.

ChangeLog
libltdl/ltdl.c

index 47fb87ee2ef7fdd241ad1faf149496da9bb71e48..e3270dc4d6b5071f063faa81e0faf9c1b6eec621 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,5 +1,8 @@
 2004-09-30  Ralf Wildenhues  <Ralf.Wildenhues@gmx.de>
 
+       * 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.
 
index 8600b1006a2210af157fdac4c52658e29019c303..5c2bc9b61570c89ac2ec4f8ddc424756498d8713 100644 (file)
@@ -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);