]> git.ipfire.org Git - thirdparty/xz.git/commitdiff
liblzma: Update assert in vli_ceil4().
authorJia Tan <jiat0218@gmail.com>
Mon, 28 Aug 2023 13:50:16 +0000 (21:50 +0800)
committerLasse Collin <lasse.collin@tukaani.org>
Tue, 7 May 2024 12:31:30 +0000 (15:31 +0300)
The argument to vli_ceil4() should always guarantee the return value
is also a valid lzma_vli. Thus the highest three valid lzma_vli values
are invalid arguments. All uses of the function ensure this so the
assert is updated to match this.

(cherry picked from commit 773f1e8622cb1465df528cb16a749517650acd93)

src/liblzma/common/index.h

index 64e97247dd33a6cd446d06820b2bc1f711e196c2..dd8ddeb3e22f21e407a4a07df7a80b32eadf2e39 100644 (file)
@@ -38,7 +38,7 @@ extern void lzma_index_prealloc(lzma_index *i, lzma_vli records);
 static inline lzma_vli
 vli_ceil4(lzma_vli vli)
 {
-       assert(vli <= LZMA_VLI_MAX);
+       assert(vli <= UNPADDED_SIZE_MAX);
        return (vli + 3) & ~LZMA_VLI_C(3);
 }