libtool-patches
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: null ptr deref in try_dlopen


From: Ralf Wildenhues
Subject: Re: null ptr deref in try_dlopen
Date: Mon, 27 Sep 2004 23:55:16 +0200
User-agent: Mutt/1.5.6+20040722i

Following a maintainer's suggestion, I am re-sending not-yet-applied
patches of myself to libtool-patches.  Find the original message by
following the References: header in the bug-libtool ML.

Regards,
Ralf

* Ralf Wildenhues wrote on Sat, Sep 25, 2004 at 05:59:42PM CEST:
> The patch below fixes a null pointer dereference in try_dlopen, ltdl.c,
> causing ltdl to try to malloc a huge amount of memory in case the user
> tries to lt_dlopen() a file with a name without an extension.
*snip*

2004-09-25  Ralf Wildenhues <address@hidden>

        * libltdl/ltdl.c (try_dlopen): Fix null pointer dereference
        in case the name given to lt_dlopen contains no extension.


Index: libltdl/ltdl.c
===================================================================
RCS file: /cvsroot/libtool/libtool/libltdl/ltdl.c,v
retrieving revision 1.213
diff -u -r1.213 ltdl.c
--- libltdl/ltdl.c      2 Sep 2004 13:27:24 -0000       1.213
+++ libltdl/ltdl.c      25 Sep 2004 15:58:13 -0000
@@ -985,6 +985,10 @@
   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);




reply via email to

[Prev in Thread] Current Thread [Next in Thread]