1
0
mirror of https://github.com/samba-team/samba.git synced 2024-12-23 17:34:34 +03:00
samba-mirror/lib/compression
Douglas Bagnall 637e7cbdba lzxpress: compress shortcut if we've reached maximum length
A simple degenerate case for our compressor has been a large number of
repeated bytes that will match the maximum length (~64k) at all 8192
search positions, 8191 of which searches are in vain because the
matches are not of greater length than the first one.

Here we recognise the inevitable and reduce runtime proportionately.

Credit to OSS-Fuzz.

REF: https://bugs.chromium.org/p/oss-fuzz/issues/detail?id=47428

Signed-off-by: Douglas Bagnall <douglas.bagnall@catalyst.net.nz>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>

Autobuild-User(master): Douglas Bagnall <dbagnall@samba.org>
Autobuild-Date(master): Tue May 17 23:11:21 UTC 2022 on sn-devel-184
2022-05-17 23:11:21 +00:00
..
lzxpress.c lzxpress: compress shortcut if we've reached maximum length 2022-05-17 23:11:21 +00:00
lzxpress.h Move common libraries from root to lib/. 2008-09-17 14:11:12 +02:00
testsuite.c lzxpress/test: time performance of long boring sequences 2022-05-17 22:13:35 +00:00
wscript_build lib/compression: add shared wscript_build. 2011-02-08 14:05:36 +01:00