From: Joseph Sutton Date: Fri, 6 Oct 2023 02:18:41 +0000 (+1300) Subject: lib:compression: Correctly fix sign extension of long matches (CID 1517275) X-Git-Tag: tevent-0.16.0~78 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=03ca8c25d09c1d6bae914c2f64d0c1e96b2b272c;p=thirdparty%2Fsamba.git lib:compression: Correctly fix sign extension of long matches (CID 1517275) Commit 6b4d94c9877ec59081b9da946c00fa2647cad928 was a previous attempt to fix this issue. Signed-off-by: Joseph Sutton Reviewed-by: Andrew Bartlett --- diff --git a/lib/compression/lzxpress_huffman.c b/lib/compression/lzxpress_huffman.c index c5da4af0d85..e14419cd96b 100644 --- a/lib/compression/lzxpress_huffman.c +++ b/lib/compression/lzxpress_huffman.c @@ -1049,7 +1049,7 @@ static ssize_t write_compressed_bytes(uint16_t symbol_values[512], } len = intermediate[i + 1]; - len |= intermediate[i + 2] << 16U; + len |= (uint32_t)intermediate[i + 2] << 16; distance = intermediate[i + 3]; i += 3; } else if (c == 0xffff) {