From: Michihiro NAKAJIMA Date: Mon, 3 Dec 2012 03:51:29 +0000 (+0900) Subject: Avoid arithmetic overflow warning(C6297) found by Visual studio X-Git-Tag: v3.1.0~25 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=a164ef53f2c38f331d2b4df8d7ff98693c4584a1;p=thirdparty%2Flibarchive.git Avoid arithmetic overflow warning(C6297) found by Visual studio static analysis. --- diff --git a/libarchive/archive_ppmd7.c b/libarchive/archive_ppmd7.c index 13a258188..fe0b0318c 100644 --- a/libarchive/archive_ppmd7.c +++ b/libarchive/archive_ppmd7.c @@ -990,7 +990,7 @@ static void RangeEnc_ShiftLow(CPpmd7z_RangeEnc *p) p->Cache = (Byte)((UInt32)p->Low >> 24); } p->CacheSize++; - p->Low = (UInt32)p->Low << 8; + p->Low = ((UInt32)p->Low << 8) & 0xFFFFFFFF; } static void RangeEnc_Encode(CPpmd7z_RangeEnc *p, UInt32 start, UInt32 size, UInt32 total)