From eaf07bdcd6f472c7f12c42a40a76ce2b07b87e19 Mon Sep 17 00:00:00 2001 From: Ralf Wildenhues Date: Sat, 1 Sep 2007 10:50:07 +0000 Subject: [PATCH] * libltdl/ltdl.c (trim): Fix possible write beyond array bound. --- ChangeLog | 2 ++ libltdl/ltdl.c | 2 +- 2 files changed, 3 insertions(+), 1 deletion(-) 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 -- 2.47.3