Skip to content

handling 4GB .idx files

Jeff King git 1 version In review

Get series with b4
b4 am [email protected]

Versions newest first

  1. v1 Latest5 patches 11 repliesIn review

Patches in v1 No applies recorded yet

#Subject and filesSizeRepliesApplied
1/5compute pack .idx byte offsets using size_tbuiltin/index-pack.c pack-check.c pack-revindex.c +1 more+9 -90 replies
2/5use size_t to store pack .idx byte offsetsbuiltin/pack-redundant.c packfile.c+5 -50 replies
3/5fsck: correctly compute checksums on idx files larger than 4GBpack-check.c+4 -40 replies
4/5block-sha1: take a size_t length parameterblock-sha1/sha1.c block-sha1/sha1.h+2 -20 replies
5/5packfile: detect overflow in .idx file size checkspackfile.c+3 -31 reply

Reviews trailers per patch

No Reviewed-by, Acked-by or Tested-by trailers for v1 yet.

Read the v1 thread

Cover letter [PATCH 0/5] handling 4GB .idx files

I recently ran into a case where Git could not read the pack it had produced via running "git repack". The culprit turned out to be an .idx file which crossed the 4GB barrier (in bytes, not number of objects). This series fixes the problems I saw, along with similar ones I couldn't trigger in practice, and protects the .idx loading code against integer overflows that would fool the size checks.

[1/5]: compute pack .idx byte offsets using size_t
[2/5]: use size_t to store pack .idx byte offsets
[3/5]: fsck: correctly compute checksums on idx files larger than 4GB [4/5]: block-sha1: take a size_t length parameter
[5/5]: packfile: detect overflow in .idx file size checks

 block-sha1/sha1.c        |  2 +-
 block-sha1/sha1.h        |  2 +-
 builtin/index-pack.c     |  2 +-
 builtin/pack-redundant.c |  6 +++---
 pack-check.c             | 10 +++++-----
 pack-revindex.c          |  2 +-
 packfile.c               | 14 +++++++-------
 7 files changed, 19 insertions(+), 19 deletions(-)

-Peff