]> git.ipfire.org Git - thirdparty/zstd.git/commit
apply limit conditions for all splitting strategies
authorYann Collet <cyan@fb.com>
Thu, 24 Oct 2024 18:36:56 +0000 (11:36 -0700)
committerYann Collet <cyan@fb.com>
Thu, 24 Oct 2024 18:36:56 +0000 (11:36 -0700)
commit90095f056d4ccb8e0ed0942b2e30a664f0489932
treea2dc7b924bc6172f0a3511905cdeea31b95c123d
parentbbda1acf85d8e2f4045156e14943817c0a389503
apply limit conditions for all splitting strategies

instead of just for blind split.

This is in anticipation of adversarial input,
that would intentionally target the sampling pattern of the split detector.

Note that, even without this protection, splitting can never expand beyond ZSTD_COMPRESSBOUND(),
because this upper limit uses a 1KB block size worst case scenario,
and splitting never creates blocks thath small.

The protection is more to ensure that data is not expanded by more than 3-bytes per 128 KB full block,
which is a much stricter limit.
lib/compress/zstd_compress.c