From: Ralf Wildenhues Date: Sat, 1 Sep 2007 10:49:19 +0000 (+0000) Subject: * libltdl/ltdl.c (trim): Fix possible write beyond array bound. X-Git-Tag: release-2-1b~70 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=4fd23486910ce184267dbc735e4531ffdd5c4ec1;p=thirdparty%2Flibtool.git * libltdl/ltdl.c (trim): Fix possible write beyond array bound. --- diff --git a/ChangeLog b/ChangeLog index e30eb769c..912c16e77 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,5 +1,7 @@ 2007-09-01 Ralf Wildenhues + * libltdl/ltdl.c (trim): Fix possible write beyond array bound. + * libltdl/ltdl.c (lt_dlopenadvise): Instead of asserting, return FILE_NOT_FOUND if the filename is "". diff --git a/libltdl/ltdl.c b/libltdl/ltdl.c index 246866d16..05f97fddd 100644 --- a/libltdl/ltdl.c +++ b/libltdl/ltdl.c @@ -989,7 +989,7 @@ trim (char **dest, const char *str) return 1; memcpy(tmp, &str[1], (end - str) - 1); - tmp[len-3] = LT_EOS_CHAR; + tmp[(end - str) - 1] = LT_EOS_CHAR; *dest = tmp; } else