Re: [PATCH v3 6/9] list-objects-filter-options: support 'auto' mode for --filter
- From
Christian Couder <christian.couder@gmail.com>
- Date
- Feb 16, 2026, 13:26 UTC
- Message-ID
- <CAP8UFD3B6ZVdp_YbjEJigiRKE5Y=i8svu5AOcUCvJMxuZQuH6w@mail.gmail.com>
- In-Reply-To
- <20260214023509.GA3684377@coredump.intra.peff.net>
On Sat, Feb 14, 2026 at 3:35 AM Jeff King <peff@peff.net> wrote:
Show 18 quoted lines
>
> On Thu, Feb 12, 2026 at 11:08:37AM +0100, Christian Couder wrote:
>
> > @@ -317,6 +346,7 @@ void list_objects_filter_release(
> > struct list_objects_filter_options *filter_options)
> > {
> > size_t sub;
> > + unsigned int allow_auto_filter = filter_options->allow_auto_filter;
> >
> > if (!filter_options)
> > return;
>
> This will segfault if anybody passes in a NULL filter_options, before we
> get to the NULL check in the context.
>
> I don't think anybody does this in practice, but probably we should
> either remove the NULL check, or you should push the assignment of your
> local variable down below it.Thanks Peff, I have moved the assignment of the local variable below the NULL check.
A v4 with this single change compared to v3 has just been sent.