diff options
| author | Jeff King <peff@peff.net> | 2023-10-09 16:59:51 -0400 |
|---|---|---|
| committer | Junio C Hamano <gitster@pobox.com> | 2023-10-09 15:55:00 -0700 |
| commit | 52e2e8d43dbae8c05b68efd60cde2aacf3a23890 (patch) | |
| tree | 9a905c9963593bbf5ceff297f65c9f34e5140df9 /commit-graph.h | |
| parent | midx: stop ignoring malformed oid fanout chunk (diff) | |
| download | git-52e2e8d43dbae8c05b68efd60cde2aacf3a23890.tar.gz git-52e2e8d43dbae8c05b68efd60cde2aacf3a23890.zip | |
commit-graph: check size of oid fanout chunk
We load the oid fanout chunk with pair_chunk(), which means we never see
the size of the chunk. We just assume the on-disk file uses the
appropriate size, and if it's too small we'll access random memory.
It's easy to check this up-front; the fanout always consists of 256
uint32's, since it is a fanout of the first byte of the hash pointing
into the oid index. These parameters can't be changed without
introducing a new chunk type.
This matches the similar check in the midx OIDF chunk (but note that
rather than checking for the error immediately, the graph code just
leaves parts of the struct NULL and checks for required fields later).
Signed-off-by: Jeff King <peff@peff.net>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
Diffstat (limited to 'commit-graph.h')
0 files changed, 0 insertions, 0 deletions
