diff options
| author | Taylor Blau <me@ttaylorr.com> | 2023-07-12 19:38:03 -0400 |
|---|---|---|
| committer | Junio C Hamano <gitster@pobox.com> | 2023-07-14 09:32:03 -0700 |
| commit | 2740ed1c76df769aa1c6e75020ace72e2cc2e47f (patch) | |
| tree | 2fdbc6edac4607bd526820b781628f31e53ad9b9 /commit.c | |
| parent | commit-graph.c: prevent overflow in `load_oid_from_graph()` (diff) | |
| download | git-2740ed1c76df769aa1c6e75020ace72e2cc2e47f.tar.gz git-2740ed1c76df769aa1c6e75020ace72e2cc2e47f.zip | |
commit-graph.c: prevent overflow in `fill_commit_graph_info()`
In a similar spirit as previous commits, ensure that we don't overflow
in a few spots within `fill_commit_graph_info()`:
- First, when computing an offset into the commit data chunk, which
can occur when the `lex_index` of the item we're looking up exceeds
2^32-1/GRAPH_DATA_WIDTH.
- A similar issue when computing the generation date offset for
commits with `lex_index` greater than 2^32-1/4. Note that in
practice this will never overflow, since the left-hand operand is
from calling `sizeof(...)` and is thus already a `size_t`. But wrap
that in an `st_mult()` to make it clear that we intend to perform
this computation using 64-bit operands.
- Finally, a nearly identical issue as above when computing an offset
into the `generation_data_overflow` chunk.
Signed-off-by: Taylor Blau <me@ttaylorr.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
Diffstat (limited to 'commit.c')
0 files changed, 0 insertions, 0 deletions
