From: Joerg Sonnenberger Date: Mon, 7 Jan 2019 18:33:25 +0000 (+0100) Subject: Force intermediate to uint64_t to make UBSAN happy. X-Git-Tag: v3.4.0~146 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=84f7fd01b68127454fcee321086b771bdc230630;p=thirdparty%2Flibarchive.git Force intermediate to uint64_t to make UBSAN happy. Reported-By: OSS-Fuzz issue 10843 --- diff --git a/libarchive/archive_read_support_format_rar5.c b/libarchive/archive_read_support_format_rar5.c index 9314f7a9f..31f9dd530 100644 --- a/libarchive/archive_read_support_format_rar5.c +++ b/libarchive/archive_read_support_format_rar5.c @@ -873,7 +873,7 @@ static int read_var(struct archive_read* a, uint64_t* pvalue, /* Strip the MSB from the input byte and add the resulting number * to the `result`. */ - result += (b & 0x7F) << shift; + result += (b & (uint64_t)0x7F) << shift; /* MSB set to 1 means we need to continue decoding process. MSB set * to 0 means we're done.