From: Wayne Davison Date: Fri, 22 Aug 2003 05:42:13 +0000 (+0000) Subject: Fixed the multiplying of blength*blength so that it can't overflow X-Git-Url: https://mattmccutchen.net/rsync/rsync.git/commitdiff_plain/fb55e28d83ab11c17b8932019362a8926598efcd Fixed the multiplying of blength*blength so that it can't overflow before it gets cast to a uint64. --- diff --git a/generator.c b/generator.c index f2e7c71d..48273f0c 100644 --- a/generator.c +++ b/generator.c @@ -155,7 +155,7 @@ static void sum_sizes_sqroot_baarda(struct sum_struct *sum, uint64 len) blength = 0; do { blength |= c; - if (len < (uint64)(blength * blength)) + if (len < (uint64)blength * blength) blength &= ~c; c >>= 1; } while (c >= 8); /* round to multiple of 8 */