Repository navigation
Conversation
--list skips blocks without decoding them, but its size checks didn't match the decoder's : - a block of an LZ4 frame larger than the frame's maximum block size was skipped, so such a frame was listed as valid while `lz4 -t` rejects it (maxBlockSize_invalid). Where long is 32-bit (Windows, 32-bit targets), a block size near 2 GB also made `nextBlock` reach LONG_MAX : assert() failure in debug builds, negative seek otherwise. - a legacy block was limited to 8 MB, but blocks of incompressible data are larger (up to LZ4_COMPRESSBOUND(8 MB), as accepted by the decoder) : --list rejected valid files made by `lz4 -l`. - a truncated legacy block was skipped with fseek() past the end of the file, so the frame was listed as valid. fseek_u32() reads the block's last byte, as for skippable frames. Tests in test-lz4-basic.sh and test-lz4-multiple-legacy.sh.
b84330808
added a commit
to b84330808/b84330808
that referenced
this pull request
Nov 5, 2026
A closed, unmerged PR also counts as landed when it was closed by a merged pull request whose commits include one authored by me (the maintainer picked my commit into their PR, e.g. lz4/lz4#2044 closed by lz4/lz4#2050).
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
lz4 --listskips blocks without decoding them, but its size checks don't match the decoder's:lz4 -tfails withmaxBlockSize_invalid. Wherelongis 32-bit (Windows, 32-bit targets), a block size near 2 GB also takesnextBlocktoLONG_MAX: theassert()fails in debug builds (Assertion failed: nextBlock < LONG_MAX), and release builds seek backward.LZ4_COMPRESSBOUND(8 MB)), so--listrejected valid files made bylz4 -l("Corrupted legacy frame").fseek()past the end of the file, so the frame was listed as valid. It now usesfseek_u32(), which reads the block's last byte, as for skippable frames (lz4io: detect truncated skippable frames in regular files #1914).Tests extend
test-lz4-basic.shandtest-lz4-multiple-legacy.sh; both fail without thelz4io.cchange. The NEWS change only adds a name to the existing--listline.