Problem: Illegal memory access in libvterm test.
Solution: Fix off-by-one error.
MANDIR=$(PREFIX)/share/man
MAN3DIR=$(MANDIR)/man3
+# Uncomment to check for memory access errors with valgrind.
+# VALGRIND=1
+
all: $(LIBRARY) $(BINFILES)
$(LIBRARY): $(OBJECTS)
#else
written = vsprintf(buffer, format, args);
- if(written >= (int)(vt->outbuffer_len - vt->outbuffer_cur)) {
+ if(written >= (int)(vt->outbuffer_len - vt->outbuffer_cur - 1)) {
/* output was truncated */
- written = vt->outbuffer_len - vt->outbuffer_cur;
+ written = vt->outbuffer_len - vt->outbuffer_cur - 1;
}
if (written > 0)
{
{
local $ENV{LD_LIBRARY_PATH} = ".libs";
my @command = "t/.libs/harness";
- unshift @command, "valgrind", "--quiet", "--error-exitcode=126" if $VALGRIND;
+ unshift @command, "valgrind", "--tool=memcheck", "--leak-check=yes", "--num-callers=25", "--log-file=valgrind.out", "--error-exitcode=126" if $VALGRIND;
$hpid = open2 $hout, $hin, @command or die "Cannot open2 harness - $!";
}
static int included_patches[] =
{ /* Add new patch number below this line */
+/**/
+ 593,
/**/
592,
/**/