mirror of
https://github.com/torvalds/linux.git
synced 2026-05-26 16:12:59 +02:00
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:
parent
c4d3fc5844
commit
a13e942a03
|
|
@ -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;
|
||||
|
|
|
|||
Loading…
Reference in New Issue
Block a user