Re: [PATCH][next] hook: check for NULL pointer before deref
- From
Patrick Steinhardt <ps@pks.im>
- Date
- Jan 9, 2026, 15:51 UTC
- Message-ID
- <aWEkCqABozBzT-QS@pks.im>
- In-Reply-To
- <20260109153528.476163-1-adrian.ratiu@collabora.com>
On Fri, Jan 09, 2026 at 05:35:28PM +0200, Adrian Ratiu wrote:
Show 18 quoted lines
> diff --git a/hook.c b/hook.c
> index 35211e5ed7..c257bd3940 100644
> --- a/hook.c
> +++ b/hook.c
> @@ -148,12 +148,11 @@ int run_hooks_opt(struct repository *r, const char *hook_name,
> };
> const char *const hook_path = find_hook(r, hook_name);
> int ret = 0;
> - const struct run_process_parallel_opts opts = {
> + struct run_process_parallel_opts opts = {
> .tr2_category = "hook",
> .tr2_label = hook_name,
>
> .processes = 1,
> - .ungroup = options->ungroup,
>
> .get_next_task = pick_next_hook,
> .start_failure = notify_start_failure,What's omitted here is that the next two lines also dereference `options`. That'll also have to be fixed for the warning to go away.
Patrick