]> git.ipfire.org Git - thirdparty/xz.git/commitdiff
Tests: test_index: Use minimal values to test integer overflow
authorLasse Collin <lasse.collin@tukaani.org>
Sat, 27 Apr 2024 13:46:01 +0000 (16:46 +0300)
committerLasse Collin <lasse.collin@tukaani.org>
Tue, 21 May 2024 21:12:07 +0000 (00:12 +0300)
(cherry picked from commit 612005bbdb0dea9dc09e9e2e9cc16a15c1480acd)

tests/test_index.c

index 20d8f47b28c273e522809dc16e013aa90da62b39..0eb10206c83c693f6a6a49d0d2637c44ad580e05 100644 (file)
@@ -1208,9 +1208,9 @@ test_lzma_index_cat(void)
        assert_true(src != NULL);
 
        assert_lzma_ret(lzma_index_append(dest, NULL,
-                       UNPADDED_SIZE_MIN, LZMA_VLI_MAX - 1), LZMA_OK);
+                       UNPADDED_SIZE_MIN, (LZMA_VLI_MAX / 2) + 1), LZMA_OK);
        assert_lzma_ret(lzma_index_append(src, NULL,
-                       UNPADDED_SIZE_MIN, LZMA_VLI_MAX - 1), LZMA_OK);
+                       UNPADDED_SIZE_MIN, (LZMA_VLI_MAX / 2) + 1), LZMA_OK);
        assert_lzma_ret(lzma_index_cat(dest, src, NULL), LZMA_DATA_ERROR);
 
        lzma_index_end(dest, NULL);