]> git.ipfire.org Git - thirdparty/linux.git/commitdiff
smb: client: compress: fix bad encoding on last LZ77 flag
authorEnzo Matsumiya <ematsumiya@suse.de>
Mon, 13 Apr 2026 19:07:07 +0000 (16:07 -0300)
committerSteve French <stfrench@microsoft.com>
Sun, 19 Apr 2026 14:46:46 +0000 (09:46 -0500)
End-of-stream flag could lead to UB because of int promotion
(overwriting signed bit).

Fix it by changing operand from '1' to '1UL'.

Signed-off-by: Enzo Matsumiya <ematsumiya@suse.de>
Signed-off-by: Steve French <stfrench@microsoft.com>
fs/smb/client/compress/lz77.c

index 96e8a8057a7721233dc49d3388d5e40b8a1bab5b..cdd6b53766b0a2b90704d2f36f07603593c03852 100644 (file)
@@ -221,7 +221,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;