mirror of
https://git.tukaani.org/xz.git
synced 2026-10-31 03:14:56 +00:00
Tests: Test that integer overflow in xz --list totals is caught
This commit is contained in:
parent
490ca91153
commit
7f539d1448
@ -130,6 +130,21 @@ if test -n "$XZ" && "$XZ" -l "$I" > /dev/null 2>&1; then
|
||||
exit 1
|
||||
fi
|
||||
|
||||
# Test that integer overflow in --list totals is caught.
|
||||
# It should succeed when the file is passed twice to xz -l and
|
||||
# fail when passed thrice.
|
||||
I="$srcdir/files/bad-1-index-huge-uncomp.xz"
|
||||
if test -n "$XZ" && "$XZ" -l "$I" "$I" > /dev/null 2>&1; then
|
||||
:
|
||||
else
|
||||
echo "xz -l unexpectedly failed when the file was used twice: $I"
|
||||
exit 1
|
||||
fi
|
||||
if test -n "$XZ" && "$XZ" -l "$I" "$I" "$I" > /dev/null 2>&1; then
|
||||
echo "xz -l unexpectedly succeeded when the file was used thrice: $I"
|
||||
exit 1
|
||||
fi
|
||||
|
||||
for I in "$srcdir"/files/unsupported-*.xz
|
||||
do
|
||||
# Test these only with xz as unsupported-check.xz will exit
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user