diff options
-rw-r--r-- | src/ptx.c | 2 | ||||
-rwxr-xr-x | tests/misc/ptx-overrun.sh | 5 |
2 files changed, 7 insertions, 0 deletions
@@ -1235,6 +1235,8 @@ fix_output_parameters (void) if ((auto_reference || input_reference) && !right_reference) line_width -= reference_max_width + gap_size; + if (line_width < 0) + line_width = 0; /* The output lines, minimally, will contain from left to right a left context, a gap, and a keyword followed by the right context with no diff --git a/tests/misc/ptx-overrun.sh b/tests/misc/ptx-overrun.sh index a4f2e382e..3b4681264 100755 --- a/tests/misc/ptx-overrun.sh +++ b/tests/misc/ptx-overrun.sh @@ -41,4 +41,9 @@ ptx ws.in ws.in | sort | uniq -u > out compare /dev/null out || fail=1 +# Trigger an invalid heap reference noticed by gcc -fsanitize=address +# from coreutils-8.25 and earlier. +echo a > a +ptx -w1 -A $PWD/a >/dev/null || fail=1 + Exit $fail |