Re: [PATCH v2 4/4] pack-check: use size_t for the size passed to verify callbacks
- From
Patrick Steinhardt <ps@pks.im>
- Date
- Nov 18, 2026, 13:34 UTC
- Message-ID
- <av2pUyAwTA7e2eOj@pks.im>
- In-Reply-To
- <00939c7f1b144fb9dbbc1745e60f7baa18217742.1794984184.git.gitter.spiros@gmail.com>
On Wed, Nov 18, 2026 at 07:56:38AM +0100, Elia Pinto wrote:
Show 10 quoted lines
> verify_pack() in pack-check.c passes each object to a verify_fn callback > (defined in pack.h) taking the object size as an "unsigned long", even > though pack-check already handles it as a size_t. This signature is also > replicated in struct odb_fsck_options (odb.h) and implemented by > fsck_obj_buffer() in builtin/fsck.c. > > On platforms where "long" is 32 bits while size_t is 64, such as > 64-bit Windows, running "git fsck" on packs with objects of 4GiB or > more passes a truncated size to fsck_obj_buffer(), causing > parse_object_buffer() and fsck_object() to inspect only a prefix.
The more interesting question to me is: if they only inspect a prefix, do they actually notice that something is off and report the error? If not that certainly sounds like a bug to me.
Patrick