summaryrefslogtreecommitdiff
path: root/builtin/fsck.c
diff options
context:
space:
mode:
authorJunio C Hamano <gitster@pobox.com>2016-07-28 10:34:42 -0700
committerJunio C Hamano <gitster@pobox.com>2016-07-28 10:34:42 -0700
commitad2d77760434e1650c186c71fa04a8fdbd77266c (patch)
treee6f51ef4203047bda1d108bed7f3ca35196d8b4c /builtin/fsck.c
parent2c608e0f7c1f0fb9fb3e42eb737d7b8543e11400 (diff)
parentec9d224903053e045d99c36149703501098b021c (diff)
downloadgit-ad2d77760434e1650c186c71fa04a8fdbd77266c.tar.gz
Merge branch 'nd/pack-ofs-4gb-limit'
"git pack-objects" and "git index-pack" mostly operate with off_t when talking about the offset of objects in a packfile, but there were a handful of places that used "unsigned long" to hold that value, leading to an unintended truncation. * nd/pack-ofs-4gb-limit: fsck: use streaming interface for large blobs in pack pack-objects: do not truncate result in-pack object size on 32-bit systems index-pack: correct "offset" type in unpack_entry_data() index-pack: report correct bad object offsets even if they are large index-pack: correct "len" type in unpack_data() sha1_file.c: use type off_t* for object_info->disk_sizep pack-objects: pass length to check_pack_crc() without truncation
Diffstat (limited to 'builtin/fsck.c')
-rw-r--r--builtin/fsck.c4
1 files changed, 4 insertions, 0 deletions
diff --git a/builtin/fsck.c b/builtin/fsck.c
index c6d17e63fd..2de272ea36 100644
--- a/builtin/fsck.c
+++ b/builtin/fsck.c
@@ -377,6 +377,10 @@ static int fsck_sha1(const unsigned char *sha1)
static int fsck_obj_buffer(const unsigned char *sha1, enum object_type type,
unsigned long size, void *buffer, int *eaten)
{
+ /*
+ * Note, buffer may be NULL if type is OBJ_BLOB. See
+ * verify_packfile(), data_valid variable for details.
+ */
struct object *obj;
obj = parse_object_buffer(sha1, type, size, buffer, eaten);
if (!obj) {