summaryrefslogtreecommitdiff
path: root/builtin/cat-file.c
diff options
context:
space:
mode:
authorJeff King <peff@peff.net>2018-11-04 02:27:46 (GMT)
committerJunio C Hamano <gitster@pobox.com>2018-11-06 03:57:08 (GMT)
commit61b0fcbb64d00d52290d433c1e754c01740b3d19 (patch)
tree4056d948123038785618385a1383b719010ea010 /builtin/cat-file.c
parent517fe807d6903c629a739b23fe0e75b892096998 (diff)
downloadgit-61b0fcbb64d00d52290d433c1e754c01740b3d19.zip
git-61b0fcbb64d00d52290d433c1e754c01740b3d19.tar.gz
git-61b0fcbb64d00d52290d433c1e754c01740b3d19.tar.bz2
midx: double-check large object write loop
The write_midx_large_offsets() function takes an array of object entries, the number of entries in the array (nr_objects), and the number of entries with large offsets (nr_large_offset). But we never actually use nr_objects; instead we keep walking down the array and counting down nr_large_offset until we've seen all of the large entries. This is correct, but we can be a bit more defensive. If there were ever a mismatch between nr_large_offset and the actual set of large-offset objects, we'd walk off the end of the array. Since we know the size of the array, we can use nr_objects to make sure we don't walk too far. Signed-off-by: Jeff King <peff@peff.net> Reviewed-by: Derrick Stolee <dstolee@microsoft.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
Diffstat (limited to 'builtin/cat-file.c')
0 files changed, 0 insertions, 0 deletions