Title [inicomp] LZSA2 may emit blocks overflowing source index past 65_535
AuthorE. C. Masloch
Created2026-07-10 20:49:03 +0200 Jul Fri
State closed

Test case: ttestr.com, ttestr.lst, generated using the command INICOMP_WINNER=smallest INICOMP_METHOD=lzsa2 INICOMP_LZSA_S=0 ./mak.sh using testrand hg a3471894d31a and kernwrap hg 4c525de10838 and inicomp hg 09184219288e. The latter includes the fix for #1010. All these revisions are from today.

E. C. Masloch on 2026-07-10 20:55:11 +0200 Jul Fri

I added a commit to my lzsa pull request that addresses the problem with a new switch:

Add capital -S, smaller blocks (<= 65_520 rather than <= 65_536)

This insures that whatever offset 0..15 is in SI after having just processed a frame header (either for a compressed or uncompressed block), adding the length of the source block won't overflow SI past 65_535. This invariant is required to efficiently handle large blocks without intra-block pointer normalisation. With large uncompressible (random data) blocks, lDOS inicomp could fail to depack as SI + length of block could overflow.