]> git.ipfire.org Git - thirdparty/libtool.git/commitdiff
* libltdl/ltdl.c (try_dlopen): Fix computation of extension,
authorRalf Wildenhues <Ralf.Wildenhues@gmx.de>
Sat, 1 Sep 2007 10:42:34 +0000 (10:42 +0000)
committerRalf Wildenhues <Ralf.Wildenhues@gmx.de>
Sat, 1 Sep 2007 10:42:34 +0000 (10:42 +0000)
avoids subtracting pointer from NULL pointer.

ChangeLog
libltdl/ltdl.c

index 052ce9f9d5002bac203cd7712c33a32b8671eb62..64d37a5cd8ee117c24b91b5628544a1becee8485 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,5 +1,8 @@
 2007-09-01  Ralf Wildenhues  <Ralf.Wildenhues@gmx.de>
 
+       * libltdl/ltdl.c (try_dlopen): Fix computation of extension,
+       avoids subtracting pointer from NULL pointer.
+
        * libltdl/ltdl.c (try_dlopen, lt_dlforeachfile): Do not test
        array address of sys_dlsearch_path against NULL, rather test for
        nonempty contents.
index 5a279978481d9972c5e06c533e9e8e0aea4793e0..5abb124b6ca0c7c69a2428d64b38f39f537557b1 100644 (file)
@@ -1209,11 +1209,11 @@ try_dlopen (lt_dlhandle *phandle, const char *filename, const char *ext,
 
   assert (base_name && *base_name);
 
+  ext = strrchr (base_name, '.');
   if (!ext)
     {
       ext = base_name + LT_STRLEN (base_name);
     }
-  ext = strrchr (base_name, '.');
 
   /* extract the module name from the file name */
   name = MALLOC (char, ext - base_name + 1);