midx: use 64-bit multiplication for chunk sizes
commit329fac3a366244ceac599ab63cd338bcc6a1dcb4
authorDerrick Stolee <dstolee@microsoft.com>
Thu, 18 Feb 2021 14:07:37 +0000 (18 14:07 +0000)
committerJunio C Hamano <gitster@pobox.com>
Thu, 18 Feb 2021 21:38:16 +0000 (18 13:38 -0800)
treeeca1be7031b7eafb708a0823fee635448bac2fb3
parent6ab3b8b8b8dc94c8e4caefb1d368cc704e70d38b
midx: use 64-bit multiplication for chunk sizes

When calculating the sizes of certain chunks, we should use 64-bit
multiplication always. This allows us to properly predict the chunk
sizes without risk of overflow.

Other possible overflows were discovered by evaluating each
multiplication in midx.c and ensuring that at least one side of the
operator was of type size_t or off_t.

Signed-off-by: Derrick Stolee <dstolee@microsoft.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
midx.c