Merge pull request #193 from derfian/mppc-undefined-behavior

Clean up undefined behavior in complicated and/or/shift expression
This commit is contained in:
Henrik Andersson 2017-11-24 09:49:21 +01:00 committed by GitHub
commit 45d625b20e
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

6
mppc.c
View File

@ -349,9 +349,9 @@ mppc_expand(uint8 * data, uint32 clen, uint8 ctype, uint32 * roff, uint32 * rlen
} }
match_bits = match_len; match_bits = match_len;
match_len = match_len = (walker >> (32 - match_bits));
((walker >> (32 - match_bits)) & (~(-1 << match_bits))) | (1 << match_len &= ((1 << match_bits) - 1);
match_bits); match_len |= (1 << match_bits);
walker <<= match_bits; walker <<= match_bits;
walker_len -= match_bits; walker_len -= match_bits;
} }