Subject: [PATCH 0/5] Number truncation with 4+ GB files on 32-bit systems

From: Nguyễn Thái Ngọc Duy <[email-masked]>
Date: Tue, 5 Jul 2016 19:05:53 +0200

Since I now could reproduce the problem that Christoph showed, I
decided to send the good patches out. To sum up, we use "unsigned
long" in some places related to file size. On 32-bit systems, it's
limited to 32 bits even though the system can handle files larger than
that (off_t is 64-bit). This fixes it.

clang -Wshorten-64-to-32 is very helpful to spot these problems. I
have a couple more patches to clean all these warnings, but some need
more code study to see what is the right way to do.

Most of the rest seems harmless, except for the local variable "size"
in builtin/pack-objects.c:write_one(). I might send 6/5 for that one.

Nguyễn Thái Ngọc Duy (5):
  pack-objects: pass length to check_pack_crc() without truncation
  sha1_file.c: use type off_t* for object_info->disk_sizep
  index-pack: correct "len" type in unpack_data()
  index-pack: report correct bad object offsets even if they are large
  index-pack: correct "offset" type in unpack_entry_data()

 builtin/cat-file.c     |  4 ++--
 builtin/index-pack.c   | 23 ++++++++++++-----------
 builtin/pack-objects.c |  2 +-
 cache.h                |  2 +-
 sha1_file.c            |  2 +-
 5 files changed, 17 insertions(+), 16 deletions(-)

-- 
2.8.2.537.g0965dd9