From: Sylvestre Ledru Date: Sun, 7 Jun 2026 09:54:40 +0000 (+0200) Subject: tests: split: reject excessively large suffix lengths X-Git-Url: http://git.ipfire.org/gitweb/?a=commitdiff_plain;h=c8ce189cbd298d02dd379edcdc6c2992b2854098;p=thirdparty%2Fcoreutils.git tests: split: reject excessively large suffix lengths * tests/split/suffix-length.sh: Ensure that a pathologically large -a/--suffix-length value fails gracefully rather than crashing or hanging. https://github.com/uutils/coreutils/pull/12609 Closes https://github.com/coreutils/coreutils/pull/282 --- diff --git a/tests/split/suffix-length.sh b/tests/split/suffix-length.sh index 84fce04a26..0b2bf3894a 100755 --- a/tests/split/suffix-length.sh +++ b/tests/split/suffix-length.sh @@ -73,4 +73,13 @@ rm -f x* returns_ 1 split -a2 -n1000 < /dev/null || fail=1 test -f xaa && fail=1 +# Ensure that an excessively large suffix length fails gracefully, +# rather than crashing or hanging. +rm -f x* +vm=$(get_min_ulimit_v_ split -a 1 /dev/null) +if test -n "$vm"; then + (ulimit -v $(($vm+6000)) && returns_ 1 split -a 66542562175252 in) || fail=1 + test -f xaa && fail=1 +fi + Exit $fail