From: Joseph Sutton Date: Mon, 7 Mar 2022 23:25:59 +0000 (+1300) Subject: compression: Use correct values for max len and offset X-Git-Tag: talloc-2.3.4~158 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=877f007f32d2cee8944b747be988cc062d13d5c0;p=thirdparty%2Fsamba.git compression: Use correct values for max len and offset Signed-off-by: Joseph Sutton Reviewed-by: Douglas Bagnall --- diff --git a/lib/compression/lzxpress.c b/lib/compression/lzxpress.c index 18d0c3183a6..6233e4072ac 100644 --- a/lib/compression/lzxpress.c +++ b/lib/compression/lzxpress.c @@ -92,12 +92,12 @@ ssize_t lzxpress_compress(const uint8_t *uncompressed, int32_t offset; - max_offset = MIN(0x1FFF, max_offset); + max_offset = MIN(0x2000, max_offset); /* search for the longest match in the window for the lookahead buffer */ for (offset = 1; (uint32_t)offset <= max_offset; offset++) { /* maximum len we can encode into metadata */ - uint32_t max_len = MIN(0x1FFF, uncompressed_size - uncompressed_pos); + const uint32_t max_len = MIN(0xFFFF + 3, uncompressed_size - uncompressed_pos); uint32_t len;