From bf2503089b19d1462be7838ed7364361481587d4 Mon Sep 17 00:00:00 2001 From: Kyle Edwards Date: Fri, 11 Jan 2019 16:22:37 -0500 Subject: liblzma: fix undefined shift result When a 32-bit integer is shifted left by 32 bits, the result is undefined. Shift a 64-bit integer instead. --- Utilities/cmliblzma/liblzma/simple/x86.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Utilities/cmliblzma/liblzma/simple/x86.c b/Utilities/cmliblzma/liblzma/simple/x86.c index 23d0c42..b38cebf 100644 --- a/Utilities/cmliblzma/liblzma/simple/x86.c +++ b/Utilities/cmliblzma/liblzma/simple/x86.c @@ -97,7 +97,7 @@ x86_code(void *simple_ptr, uint32_t now_pos, bool is_encoder, if (!Test86MSByte(b)) break; - src = dest ^ ((1u << (32 - i * 8)) - 1); + src = dest ^ ((1ull << (32 - i * 8)) - 1); } buffer[buffer_pos + 4] -- cgit v0.12