]> git.ipfire.org Git - thirdparty/zlib-ng.git/commitdiff
Fix potential overflow before widening in makecrtc.
authorMika Lindqvist <postmaster@raasu.org>
Wed, 26 Apr 2023 16:28:43 +0000 (19:28 +0300)
committerHans Kristian Rosbach <hk-git@circlestorm.org>
Thu, 27 Apr 2023 22:28:13 +0000 (00:28 +0200)
tools/makecrct.c

index b5469b7d39c77ab089c47323f87c26d7116cb9f5..5c3ba58a1a6237afe4d89155677410b8a0d4652e 100644 (file)
@@ -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++) {