mirror of
git://git.sv.gnu.org/coreutils.git
synced 2026-07-26 10:39:01 +02:00
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
This commit is contained in:
committed by
Pádraig Brady
parent
5008d5d112
commit
c8ce189cbd
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user