Commit 329fac3
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>1 parent 6ab3b8b commit 329fac3
1 file changed
+6
-5
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
244 | 244 | | |
245 | 245 | | |
246 | 246 | | |
247 | | - | |
| 247 | + | |
248 | 248 | | |
249 | 249 | | |
250 | 250 | | |
| |||
260 | 260 | | |
261 | 261 | | |
262 | 262 | | |
263 | | - | |
| 263 | + | |
| 264 | + | |
264 | 265 | | |
265 | 266 | | |
266 | 267 | | |
| |||
912 | 913 | | |
913 | 914 | | |
914 | 915 | | |
915 | | - | |
| 916 | + | |
916 | 917 | | |
917 | 918 | | |
918 | | - | |
| 919 | + | |
919 | 920 | | |
920 | 921 | | |
921 | 922 | | |
922 | 923 | | |
923 | | - | |
| 924 | + | |
924 | 925 | | |
925 | 926 | | |
926 | 927 | | |
| |||
0 commit comments