summaryrefslogtreecommitdiff
path: root/builtin/index-pack.c
diff options
context:
space:
mode:
authorNguyễn Thái Ngọc Duy <pclouds@gmail.com>2016-07-13 15:44:02 (GMT)
committerJunio C Hamano <gitster@pobox.com>2016-07-13 16:15:08 (GMT)
commitda49a7da3ad5e31fa858a6d48d8a6af9c4690724 (patch)
treefbdf2983e7c31fff8a024b04d887e71b3519da79 /builtin/index-pack.c
parentfd3e67474c0b349049ccff5f72a50ef930a56013 (diff)
downloadgit-da49a7da3ad5e31fa858a6d48d8a6af9c4690724.zip
git-da49a7da3ad5e31fa858a6d48d8a6af9c4690724.tar.gz
git-da49a7da3ad5e31fa858a6d48d8a6af9c4690724.tar.bz2
index-pack: correct "offset" type in unpack_entry_data()
unpack_entry_data() receives an off_t value from unpack_raw_entry(), which could be larger than unsigned long on 32-bit systems with large file support. Correct the type so truncation does not happen. This only affects bad object reporting though. Signed-off-by: Nguyễn Thái Ngọc Duy <pclouds@gmail.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
Diffstat (limited to 'builtin/index-pack.c')
-rw-r--r--builtin/index-pack.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/builtin/index-pack.c b/builtin/index-pack.c
index e2d8ae4..1008d7f 100644
--- a/builtin/index-pack.c
+++ b/builtin/index-pack.c
@@ -430,7 +430,7 @@ static int is_delta_type(enum object_type type)
return (type == OBJ_REF_DELTA || type == OBJ_OFS_DELTA);
}
-static void *unpack_entry_data(unsigned long offset, unsigned long size,
+static void *unpack_entry_data(off_t offset, unsigned long size,
enum object_type type, unsigned char *sha1)
{
static char fixed_buf[8192];