Re: [PATCH 2/2] packfile: fix corruption due to stale delta base cache entries
Jeff King <peff@peff.net> writes:
Show 18 quoted lines
> 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'.