Re: [PATCH 1/5] pack-objects: pass length to check_pack_crc() without truncation

2016-07-12 Thread Junio C Hamano
Nguyễn Thái Ngọc Duy writes: > diff --git a/builtin/pack-objects.c b/builtin/pack-objects.c > index 8f5e358..df6ecd5 100644 > --- a/builtin/pack-objects.c > +++ b/builtin/pack-objects.c > @@ -349,7 +349,7 @@ static unsigned long write_reuse_object(struct sha1file > *f, struct object_entry >

[PATCH 1/5] pack-objects: pass length to check_pack_crc() without truncation

2016-07-05 Thread Nguyễn Thái Ngọc Duy
On 32 bit systems with large file support, unsigned long is 32-bit while the two offsets in the subtraction expression (pack-objects has the exact same expression as in sha1_file.c but not shown in diff) are in 64-bit. If an in-pack object is larger than 2^32 len/datalen is truncated and we get a m