smb: client: compress: fix bad encoding on last LZ77 flag

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>
This commit is contained in:
Enzo Matsumiya 2026-04-13 16:07:07 -03:00 committed by Steve French
parent c4d3fc5844
commit a13e942a03

View 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;