From: Junio C Hamano Date: Wed, 07 Oct 2026 18:00:56 GMT Subject: Re: [PATCH 2/2] packfile: fix corruption due to stale delta base cache entries Message-ID: In-Reply-To: <20261007081844.GA606386@coredump.intra.peff.net> Jeff King writes: > Ah, I get it now. It is a little funny to key the hash on the in-core > pointer we happen to have, but it does provide a certain uniqueness. I > suspect that doing this would be mostly correct: > ... > and would trigger the use-after-free, but: > > 1. It introduces weird semantic questions, like: what if you freed and > then reopened a pack of the same name and it didn't have the same > contents? > > 2. It's more expensive. > > 3. Changing the bug from "hard to detect hash equality mismatch" to > "undefined behavior" is not really much of an improvement. ;) > > So I think just fixing the bug is good, along with accepting that it > only triggered in certain specific cases and testing that. And your > patch looks like the obviously correct fix. Thanks for writing and reviewing, all. Very much appreciated. Let me mark the topic for 'next'.