]> git.ipfire.org Git - thirdparty/libtool.git/commitdiff
* libltdl/ltdl.c (trim): Fix possible write beyond array bound.
authorRalf Wildenhues <Ralf.Wildenhues@gmx.de>
Sat, 1 Sep 2007 10:49:19 +0000 (10:49 +0000)
committerRalf Wildenhues <Ralf.Wildenhues@gmx.de>
Sat, 1 Sep 2007 10:49:19 +0000 (10:49 +0000)
ChangeLog
libltdl/ltdl.c

index e30eb769c40f40726dfd76d61d5b85e198fc148a..912c16e77ac23539742c14766a0923448903da22 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,5 +1,7 @@
 2007-09-01  Ralf Wildenhues  <Ralf.Wildenhues@gmx.de>
 
+       * 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 "".
 
index 246866d1624efba54c1e0ee65353fea3fdd28600..05f97fdddccebcbd1967411f1c43270886b5e73f 100644 (file)
@@ -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