diff options
| author | Taylor Blau <me@ttaylorr.com> | 2023-07-12 19:37:32 -0400 |
|---|---|---|
| committer | Junio C Hamano <gitster@pobox.com> | 2023-07-14 09:32:03 -0700 |
| commit | a519abca02eeca7dce864717b9664c62a124e1c0 (patch) | |
| tree | 0c229295314569b43ec13fa53e2e1044a74e9ccf /commit-graph.c | |
| parent | packfile.c: prevent overflow in `load_idx()` (diff) | |
| download | git-a519abca02eeca7dce864717b9664c62a124e1c0.tar.gz git-a519abca02eeca7dce864717b9664c62a124e1c0.zip | |
packfile.c: use checked arithmetic in `nth_packed_object_offset()`
In a similar spirit as the previous commits, ensure that we use
`st_add()` or `st_mult()` when computing values that may overflow the
32-bit unsigned limit.
Note that in each of these instances, we prevent 32-bit overflow
already since we have explicit casts to `size_t`.
So this code is OK as-is, but let's clarify it by using the `st_xyz()`
helpers to make it obvious that we are performing the relevant
computations using 64 bits.
Signed-off-by: Taylor Blau <me@ttaylorr.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
Diffstat (limited to 'commit-graph.c')
0 files changed, 0 insertions, 0 deletions
