]> git.ipfire.org Git - thirdparty/libtool.git/commitdiff
* libltdl/ltdl.c (find_module): initialize filename if dir is NULL
authorAlexandre Oliva <oliva@dcc.unicamp.br>
Thu, 4 Feb 1999 12:39:24 +0000 (12:39 +0000)
committerAlexandre Oliva <aoliva@redhat.com>
Thu, 4 Feb 1999 12:39:24 +0000 (12:39 +0000)
Reported by Godmar Back <gback@cs.utah.edu>

1999-02-04  Godmar Back  <gback@cs.utah.edu>

* libltdl/ltdl.c (lt_dlopenext): missing space for terminator when
allocating memory for shlib_ext

ChangeLog
libltdl/ltdl.c

index e4c5f9a636601df09bc8ba48a74562b92e877792..743778627a457e072da23191249700b5afddec13 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,7 +1,17 @@
+1999-02-04  Alexandre Oliva  <oliva@dcc.unicamp.br>
+
+       * libltdl/ltdl.c (find_module): initialize filename if dir is NULL 
+       Reported by Godmar Back <gback@cs.utah.edu>
+
+1999-02-04  Godmar Back  <gback@cs.utah.edu>
+
+       * libltdl/ltdl.c (lt_dlopenext): missing space for terminator when
+       allocating memory for shlib_ext
+
 1999-02-03  Alexandre Oliva  <oliva@dcc.unicamp.br>
 
-       * ltdl.c (lt_dlopenext): tmp would be trashed if shlib_ext was
-       longer than 3 characters
+       * libltdl/ltdl.c (lt_dlopenext): tmp would be trashed if shlib_ext
+       was longer than 3 characters
 
 1999-02-02  Gary V. Vaughan  <gvaughan@oranda.demon.co.uk>
 
index 1413741b33583e5d2751bf1ec9aacf3942300150..f53f50bfc8490672a4755ef83d3891c32e733e8f 100644 (file)
@@ -840,6 +840,8 @@ find_module (handle, dir, libdir, dlname, old_name, installed)
                        }
                        if (dir)
                                strcpy(filename, dir);
+                       else
+                               *filename = 0;
                        strcat(filename, objdir);
                        strcat(filename, dlname);
 
@@ -857,6 +859,8 @@ find_module (handle, dir, libdir, dlname, old_name, installed)
                                       + strlen(dlname) + 1);
                        if (dir)
                                strcpy(filename, dir);
+                       else
+                               *filename = 0;
                        strcat(filename, dlname);
                        ret = tryall_dlopen(handle, filename) == 0;
                        free(filename);
@@ -1240,7 +1244,7 @@ lt_dlopenext (filename)
        /* try "filename.EXT" */
        if (strlen(shlib_ext) > 3) {
                free(tmp);
-               tmp = (char*) malloc(len + strlen(shlib_ext));
+               tmp = (char*) malloc(len + strlen(shlib_ext) + 1);
                if (!tmp) {
                        last_error = memory_error;
                        return 0;