diffutils/tests/bignum
Paul Eggert 1fa6140faa diff: fix integer overflow problem with --tabsize
Reported by Tobias Stoeckmann in: http://bugs.gnu.org/18857
* src/diff.c (main): Don't overflow if INTMAX_MAX / 2 < tabsize.
* tests/bignum: New file, to test for this bug.
* tests/Makefile.am (TESTS): Add it.
2014-10-27 19:53:44 -07:00

15 lines
258 B
Bash
Executable File

#!/bin/sh
# big numbers
. "${srcdir=.}/init.sh"; path_prepend_ ../src
fail=0
for tabsize in 2147483648 9223372036854775808; do
diff --tabsize=$tabsize /dev/null /dev/null
status=$?
test $status -eq 0 || test $status -eq 2 || fail=1
done
Exit $fail