Merge branch 'mc/clean-smudge-with-llp64'
The clean/smudge conversion code path has been prepared to better work on platforms where ulong is narrower than size_t. * mc/clean-smudge-with-llp64: clean/smudge: allow clean filters to process extremely large files odb: guard against data loss checking out a huge file git-compat-util: introduce more size_t helpers odb: teach read_blob_entry to use size_t t1051: introduce a smudge filter test for extremely large files test-lib: add prerequisite for 64-bit platforms test-tool genzeros: generate large amounts of data more efficiently test-genzeros: allow more than 2G zeros in Windows
This commit is contained in:
@ -1060,7 +1060,7 @@ unsigned long unpack_object_header_buffer(const unsigned char *buf,
|
||||
unsigned long len, enum object_type *type, unsigned long *sizep)
|
||||
{
|
||||
unsigned shift;
|
||||
unsigned long size, c;
|
||||
size_t size, c;
|
||||
unsigned long used = 0;
|
||||
|
||||
c = buf[used++];
|
||||
@ -1074,10 +1074,10 @@ unsigned long unpack_object_header_buffer(const unsigned char *buf,
|
||||
break;
|
||||
}
|
||||
c = buf[used++];
|
||||
size += (c & 0x7f) << shift;
|
||||
size = st_add(size, st_left_shift(c & 0x7f, shift));
|
||||
shift += 7;
|
||||
}
|
||||
*sizep = size;
|
||||
*sizep = cast_size_t_to_ulong(size);
|
||||
return used;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user