From d6da938cfe0ebdc9bb953f340bfb39ed039ba09e Mon Sep 17 00:00:00 2001 From: "Gary V. Vaughan" Date: Mon, 29 Mar 1999 13:22:00 +0000 Subject: [PATCH] * 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. --- ChangeLog | 7 +++++++ libltdl/ltdl.c | 3 ++- 2 files changed, 9 insertions(+), 1 deletion(-) diff --git a/ChangeLog b/ChangeLog index ed70d8a66..68edbd927 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,10 @@ +1999-03-29 Gary V. Vaughan + + * 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 * NEWS: updated diff --git a/libltdl/ltdl.c b/libltdl/ltdl.c index 734476206..f0a344a08 100644 --- a/libltdl/ltdl.c +++ b/libltdl/ltdl.c @@ -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); -- 2.47.3