aboutsummaryrefslogtreecommitdiff
path: root/tests/test_files.sh
diff options
context:
space:
mode:
authorLasse Collin <lasse.collin@tukaani.org>2022-09-16 17:08:53 +0300
committerLasse Collin <lasse.collin@tukaani.org>2022-09-16 17:08:53 +0300
commitc3592d0a55114144686ecf960cb516d6b31c98e9 (patch)
treeb0b3558d0f8a9db2667e3e1239d7c1bb0afcbe9a /tests/test_files.sh
parentTranslations: Add Turkish translation. (diff)
downloadxz-c3592d0a55114144686ecf960cb516d6b31c98e9.tar.xz
Tests: Add a test file for lzma_index_append() integer overflow bug.
This test fails before commit 18d7facd3802b55c287581405c4d49c98708c136. test_files.sh now runs xz -l for bad-3-index-uncomp-overflow.xz because only then the previously-buggy code path gets tested. Normal decompression doesn't use lzma_index_append() at all. Instead, lzma_index_hash functions are used and those already did the overflow check.
Diffstat (limited to 'tests/test_files.sh')
-rwxr-xr-xtests/test_files.sh8
1 files changed, 8 insertions, 0 deletions
diff --git a/tests/test_files.sh b/tests/test_files.sh
index dc507912..8686b6db 100755
--- a/tests/test_files.sh
+++ b/tests/test_files.sh
@@ -53,6 +53,14 @@ do
fi
done
+# Testing for the lzma_index_append() bug in <= 5.2.6 needs "xz -l":
+I="$srcdir/files/bad-3-index-uncomp-overflow.xz"
+if test -n "$XZ" && "$XZ" -l "$I" > /dev/null 2>&1; then
+ echo "Bad file succeeded with xz -l: $I"
+ (exit 1)
+ exit 1
+fi
+
for I in "$srcdir"/files/good-*.lzma
do
if test -z "$XZ" || "$XZ" -dc "$I" > /dev/null; then