Skip to content

Commit da49a7d

Browse files
pcloudsgitster
authored andcommitted
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 <[email protected]> Signed-off-by: Junio C Hamano <[email protected]>
1 parent fd3e674 commit da49a7d

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

builtin/index-pack.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -430,7 +430,7 @@ static int is_delta_type(enum object_type type)
430430
return (type == OBJ_REF_DELTA || type == OBJ_OFS_DELTA);
431431
}
432432

433-
static void *unpack_entry_data(unsigned long offset, unsigned long size,
433+
static void *unpack_entry_data(off_t offset, unsigned long size,
434434
enum object_type type, unsigned char *sha1)
435435
{
436436
static char fixed_buf[8192];

0 commit comments

Comments
 (0)