From: Mika Lindqvist Date: Wed, 26 Apr 2023 16:28:43 +0000 (+0300) Subject: Fix potential overflow before widening in makecrtc. X-Git-Tag: 2.1.0-beta1~1 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=2d5d0a2bafb4314b4310577824b5a949058db404;p=thirdparty%2Fzlib-ng.git Fix potential overflow before widening in makecrtc. --- diff --git a/tools/makecrct.c b/tools/makecrct.c index b5469b7d3..5c3ba58a1 100644 --- a/tools/makecrct.c +++ b/tools/makecrct.c @@ -93,7 +93,7 @@ static void braid(uint32_t ltl[][256], z_word_t big[][256], int n, int w) { int k; uint32_t i, p, q; for (k = 0; k < w; k++) { - p = x2nmodp((n * w + 3 - k) << 3, 0); + p = x2nmodp(((z_off64_t)n * w + 3 - k) << 3, 0); ltl[k][0] = 0; big[w - 1 - k][0] = 0; for (i = 1; i < 256; i++) {