From: Torsten Bögershausen Date: Thu, 30 Apr 2026 14:13:20 GMT Subject: Re: [PATCH 1/6] index-pack, unpack-objects: use size_t for object size Message-ID: <20260430141320.GA6659@tb-raspi4> In-Reply-To: On Tue, Apr 28, 2026 at 04:26:15PM +0000, Johannes Schindelin via GitGitGadget wrote: > From: Johannes Schindelin > > When unpacking objects from a packfile, the object size is decoded > from a variable-length encoding. On platforms where unsigned long is > 32-bit (such as Windows, even in 64-bit builds), the shift operation > overflows when decoding sizes larger than 4GB. The result is a > truncated size value, causing the unpacked object to be corrupted or > rejected. > > Fix this by changing the size variable to size_t, which is 64-bit on > 64-bit platforms, and ensuring the shift arithmetic occurs in 64-bit > space. > > This was originally authored by LordKiRon , > who preferred not to reveal their real name and therefore agreed that I > take over authorship. Good to see things moving forward. See even https://github.com/git-for-windows/git/pull/2179 which is probably obsolete soon.