Skip to content

Commit c2eaa81

Browse files
committed
lzma: fix overflow in Ppmd7Enc.c
crnlib/lzma/Ppmd7Enc.c: R->Low += start * R->Range; Multiplication result may overflow 'unsigned int' before it is converted to 'unsigned long'.
1 parent ad78027 commit c2eaa81

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

crnlib/lzma/Ppmd7Enc.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -58,7 +58,7 @@ Z7_FORCE_INLINE
5858
// Z7_NO_INLINE
5959
static void Ppmd7z_RangeEnc_Encode(CPpmd7 *p, UInt32 start, UInt32 size)
6060
{
61-
R->Low += start * R->Range;
61+
R->Low += (UInt64)start * (UInt64)R->Range;
6262
R->Range *= size;
6363
RC_NORM_LOCAL(p)
6464
}

0 commit comments

Comments
 (0)