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>
Nguyễn Thái Ngọc Duy committed
Jul 13, 2016 at 17:44 UTC
da49a7da3ad5e31fa858a6d48d8a6af9c4690724
1 file changed
+1
-1
builtin/index-pack.c
+1
-1
@@ -430,7 +430,7 @@ static int is_delta_type(enum object_type type)
430
return (type == OBJ_REF_DELTA || type == OBJ_OFS_DELTA);
431
}
432
433
-static void *unpack_entry_data(unsigned long offset, unsigned long size,
433
+static void *unpack_entry_data(off_t offset, unsigned long size,
434
enum object_type type, unsigned char *sha1)
435
{
436
static char fixed_buf[8192];