diff options
author | Jeff King <peff@peff.net> | 2023-10-10 00:02:03 +0300 |
---|---|---|
committer | Junio C Hamano <gitster@pobox.com> | 2023-10-10 01:55:00 +0300 |
commit | fc926567ede1f82799ef49dd54aa37b4497a5453 (patch) | |
tree | e673d9a8f88a8ad834b7398ca75a0d37c7ed35e1 /commit-graph.c | |
parent | 52e2e8d43dbae8c05b68efd60cde2aacf3a23890 (diff) |
midx: check size of oid lookup chunk
When reading an on-disk multi-pack-index, we take the number of objects
in the midx from the final value of the fanout table. But we just
blindly assume that the chunk containing the actual oid entries is the
correct size. This can lead to us reading out-of-bounds memory if the
lookup chunk is too small (or if the fanout is corrupted; when they
don't agree we cannot tell which one is wrong).
Note that we bump the assignment of m->num_objects into the fanout
parser callback, so that it's set when we parse the lookup table
(otherwise we'd have to manually record the lookup table size and check
it later).
Signed-off-by: Jeff King <peff@peff.net>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
Diffstat (limited to 'commit-graph.c')
0 files changed, 0 insertions, 0 deletions