Re: [PATCH v4 03/16] ref-filter: clear reachable list pointers after freeing
- From
Jeff King <peff@peff.net>
- Date
- Jul 3, 2023, 05:16 UTC
- Message-ID
- <20230703051625.GC3502534@coredump.intra.peff.net>
- In-Reply-To
- <7e6bf7766d020914af53e7d6926f5a6c4c4d0668.1687270849.git.me@ttaylorr.com>
On Tue, Jun 20, 2023 at 10:21:11AM -0400, Taylor Blau wrote:
Show 6 quoted lines
> From: Jeff King <peff@peff.net> > > In reach_filter(), we pop all commits from the reachable lists, leaving > them empty. But because we're operating on a list pointer that was > passed by value, the original filter.reachable_from pointer is left > dangling.
Yep. This isn't a bug (yet) because nobody looks at the now-dangling pointer. So as with the last patch, we're future-proofing ourselves against dangerous situations.
-Peff