git/list[1] front-page[2] threads[3] people[4] search[5] about
 

Re: [PATCH][next] hook: check for NULL pointer before deref

From
Adrian Ratiu <adrian.ratiu@collabora.com>
Date
Jan 9, 2026, 15:57 UTC
Message-ID
<87ecnywzhd.fsf@collabora.com>
In-Reply-To
<aWEkCqABozBzT-QS@pks.im>
On Fri, 09 Jan 2026, Patrick Steinhardt <ps@pks.im> wrote:
Show 22 quoted lines
> On Fri, Jan 09, 2026 at 05:35:28PM +0200, Adrian Ratiu wrote:
>> 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.
Thanks for spotting this. Will fix in the same way.
Previous: Patrick Steinhardt
Message 3 of 3 in “[next] hook: check for NULL pointer before deref”
  1. [next] hook: check for NULL pointer before derefAdrian Ratiu, Jan 9, 2026
  2. Patrick SteinhardtJan 9, 2026
  3. Adrian RatiuJan 9, 2026

Read the whole thread, see it on lore, or plain text.

$ cat FOOTERMessages come from the public archive at lore.kernel.org/git, fetched every hour. The front page is chosen and written each morning by an AI editor and can be wrong; the threads themselves are the record. About and API. For agents: an MCP server at https://gitlist.dev/mcp, and any thread, story or person page as Markdown by adding .md to its URL (or sending Accept: text/markdown). Details in /llms.txt.