From 8ef77e98f9e2a4af01fbcd7f8ff09682e10554a7 Mon Sep 17 00:00:00 2001 From: Enzo Matsumiya Date: Mon, 1 Dec 2025 12:14:57 -0300 Subject: smb: client: compress: fix end-of-stream flag in end of buffer Fix end of stream flag for not-so-rare cases where flag_count is 0 and flag position is in the last 4 bytes of @dstp; the bitshift wraps the flag, causing a zero flag to be written, thus making decompressors interpret it as "more literals to write". Fix this by using `1UL' instead. Signed-off-by: Enzo Matsumiya --- fs/smb/client/compress/lz77.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/fs/smb/client/compress/lz77.c b/fs/smb/client/compress/lz77.c index e32a9bd9a94f..80c57175769d 100644 --- a/fs/smb/client/compress/lz77.c +++ b/fs/smb/client/compress/lz77.c @@ -223,7 +223,7 @@ noinline int lz77_compress(const void *src, u32 slen, void *dst, u32 *dlen) } flag <<= (32 - flag_count); - flag |= (1 << (32 - flag_count)) - 1; + flag |= (1UL << (32 - flag_count)) - 1; lz77_write32(flag_pos, flag); *dlen = dstp - dst; -- cgit v1.2.3