summaryrefslogtreecommitdiff
path: root/commit-graph.h
diff options
context:
space:
mode:
authorJeff King <peff@peff.net>2023-10-09 17:05:44 -0400
committerJunio C Hamano <gitster@pobox.com>2023-10-09 15:55:01 -0700
commit4a3c34662bc56a0e2369635536ac2ee1e79d8f56 (patch)
treece4eb9e113ee84a992e8503a8a0436c9801d3568 /commit-graph.h
parent6cf61d0db55291c3b8406a6ba8f20fdfb9a4a344 (diff)
commit-graph: check size of generations chunk
We neither check nor record the size of the generations chunk we parse from a commit-graph file. This should have one uint32_t for each commit in the file; if it is smaller (due to corruption, etc), we may read outside the mapped memory. The included test segfaults without this patch, as it shrinks the size considerably (and the chunk is near the end of the file, so we read off the end of the array rather than accidentally reading another chunk). We can fix this by checking the size up front (like we do for other fixed-size chunks, like CDAT). 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