]> git.ipfire.org Git - thirdparty/libtool.git/commitdiff
* libltdl/ltdl.c (lt_dladdsearchdir): Forgot to mallocate the
authorGary V. Vaughan <gary@gnu.org>
Mon, 29 Mar 1999 13:22:00 +0000 (13:22 +0000)
committerGary V. Vaughan <gary@gnu.org>
Mon, 29 Mar 1999 13:22:00 +0000 (13:22 +0000)
extra byte of memory for the teminating NUL, and forgot to
strcpy the original path in to the new memory before appending
the new path compononent.

ChangeLog
libltdl/ltdl.c

index ed70d8a6677e5b1bbb1134cc88f797d1e2576602..68edbd92762fedd38db219b69b95b5d311719d43 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,10 @@
+1999-03-29  Gary V. Vaughan  <gary@gnu.org>
+
+       * libltdl/ltdl.c (lt_dladdsearchdir): Forgot to mallocate the
+       extra byte of memory for the teminating NUL, and forgot to
+       strcpy the original path in to the new memory before appending
+       the new path compononent.
+
 1999-03-27 Thomas Tanner  <tanner@gmx.de>
 
        * NEWS: updated
index 734476206104fafca127510e40f76eeeffbeffe3..f0a344a0886e48166ba13af979f611913f1f0711 100644 (file)
@@ -1535,11 +1535,12 @@ lt_dladdsearchdir (search_dir)
        } else {
                char    *new_search_path = (char*)
                        lt_dlmalloc(strlen(user_search_path) + 
-                               strlen(search_dir) + 1);
+                               strlen(search_dir) + 2); /* ':' + '\0' == 2 */
                if (!new_search_path) {
                        last_error = memory_error;
                        return 1;
                }
+               strcpy(new_search_path, user_search_path);
                strcat(new_search_path, ":");
                strcat(new_search_path, search_dir);
                lt_dlfree(user_search_path);