From: Ralf Wildenhues Date: Sat, 1 Sep 2007 10:50:07 +0000 (+0000) Subject: * libltdl/ltdl.c (trim): Fix possible write beyond array bound. X-Git-Tag: release-1-5-26~26 X-Git-Url: http://git.ipfire.org/gitweb/gitweb.cgi?a=commitdiff_plain;h=eaf07bdcd6f472c7f12c42a40a76ce2b07b87e19;p=thirdparty%2Flibtool.git * libltdl/ltdl.c (trim): Fix possible write beyond array bound. --- diff --git a/ChangeLog b/ChangeLog index 998c0d5d4..eb9e2d3ba 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 (try_dlopen): Do not test array address of sys_dlsearch_path against NULL, rather test for nonempty contents. diff --git a/libltdl/ltdl.c b/libltdl/ltdl.c index 5135fbe24..a83a02c6d 100644 --- a/libltdl/ltdl.c +++ b/libltdl/ltdl.c @@ -3043,7 +3043,7 @@ trim (dest, str) return 1; strncpy(tmp, &str[1], (end - str) - 1); - tmp[len-3] = LT_EOS_CHAR; + tmp[(end - str) - 1] = LT_EOS_CHAR; *dest = tmp; } else