diff options
| author | Enzo Matsumiya <ematsumiya@suse.de> | 2025-12-01 12:14:57 -0300 |
|---|---|---|
| committer | Enzo Matsumiya <ematsumiya@suse.de> | 2025-12-01 17:05:36 -0300 |
| commit | 8ef77e98f9e2a4af01fbcd7f8ff09682e10554a7 (patch) | |
| tree | e0006c8fe176cb0169c4a1cc954e34c555ac857c | |
| parent | 9607329b3a7cbfe1a4b892141a924f41d60a5e50 (diff) | |
| download | linux-8ef77e98f9e2a4af01fbcd7f8ff09682e10554a7.tar.gz linux-8ef77e98f9e2a4af01fbcd7f8ff09682e10554a7.tar.bz2 linux-8ef77e98f9e2a4af01fbcd7f8ff09682e10554a7.zip | |
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 <ematsumiya@suse.de>
| -rw-r--r-- | fs/smb/client/compress/lz77.c | 2 |
1 files changed, 1 insertions, 1 deletions
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; |
