From 03ca8c25d09c1d6bae914c2f64d0c1e96b2b272c Mon Sep 17 00:00:00 2001 From: Joseph Sutton Date: Fri, 6 Oct 2023 15:18:41 +1300 Subject: [PATCH] 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 --- lib/compression/lzxpress_huffman.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) 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) { -- 2.47.3