git/builtin
Taylor Blau 2a15964128 builtin/repack.c: be more conservative with unsigned overflows
There are a number of places in the geometric repack code where we
multiply the number of objects in a pack by another unsigned value. We
trust that the number of objects in a pack is always representable by a
uint32_t, but we don't necessarily trust that that number can be
multiplied without overflow.

Sprinkle some unsigned_add_overflows() and unsigned_mult_overflows() in
split_pack_geometry() to check that we never overflow any unsigned types
when adding or multiplying them.

Arguably these checks are a little too conservative, and certainly they
do not help the readability of this function. But they are serving a
useful purpose, so I think they are worthwhile overall.

Suggested-by: Junio C Hamano <gitster@pobox.com>
Signed-off-by: Taylor Blau <me@ttaylorr.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2021-03-05 11:33:52 -08:00
..
2020-09-30 12:53:47 -07:00
2021-01-06 15:10:49 -08:00
2020-07-30 19:18:06 -07:00
2021-01-25 14:19:19 -08:00
2021-02-05 16:40:45 -08:00
2020-08-11 18:04:11 -07:00
2021-02-17 17:21:40 -08:00
2021-01-06 15:10:49 -08:00
2020-10-16 12:30:45 -07:00
2021-02-03 14:09:37 -08:00
2021-02-03 14:09:37 -08:00
2021-02-12 14:21:04 -08:00
2021-01-06 15:10:49 -08:00
2021-02-17 17:21:40 -08:00
2020-03-24 15:04:43 -07:00
2021-01-05 14:58:29 -08:00
2021-02-17 17:21:41 -08:00
2021-02-05 16:40:44 -08:00
2021-01-06 14:22:24 -08:00
2019-05-13 14:22:54 +09:00
2020-04-28 10:47:10 -07:00
2020-03-24 15:04:44 -07:00
2020-05-13 12:19:18 -07:00
2020-10-27 15:09:49 -07:00
2020-07-30 19:18:06 -07:00
2020-09-02 14:39:25 -07:00
2021-01-25 14:19:19 -08:00
2021-02-05 16:40:45 -08:00
2020-07-30 19:18:06 -07:00
2020-08-11 18:04:11 -07:00
2019-06-19 08:19:21 -07:00
2021-01-30 09:57:40 -08:00