Follow @Openwall on Twitter for new release announcements and other news
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20261129025553.GZ5716@brightrain.aerifal.cx>
Date: Sat, 28 Nov 2026 21:55:53 -0500
From: Rich Felker <dalias@...c.org>
To: Georg Meyer <dev@...roup.ch>
Cc: musl@...ts.openwall.com
Subject: Re: regcomp: NULL dereference in marksub when
 tre_ast_new_union fails, under a failed allocation

On Sat, Nov 28, 2026 at 09:07:28PM -0500, Georg Meyer wrote:
> In src/regex/regcomp.c, around the end of group/alternation parsing:
> 
>     nunion = tre_ast_new_union(ctx->mem, nunion, nbranch);
>     nbranch = 0;
>     ...
>     err = marksub(ctx, nunion, tre_stack_pop_int(stack));
> 
> tre_ast_new_union's result is never checked before it is passed into
> marksub().

Thanks.

> Suggested fix for reports/musl-regex-marksub-null.txt.
> [...]

The start of the commit messgae makes this look LLM-generated. Please
do not send any LLM-emitted patches to the list. We cannot use them
and in general they are potentially tainting. In this case it probably
doesn't matter, but just don't. A patch does not help. Someone who has
read and understands the actual bug report can trivially write a fix.
Having a bad-provenance proposed fix just potentially short-circuits
that process.

Rich

Powered by blists - more mailing lists

Confused about mailing lists and their use? Read about mailing lists on Wikipedia and check out these guidelines on proper formatting of your messages.