[PATCH] posix: Avoid a stack overflow when glob is given many trailing slashes [BZ #30635]
Collin Funk
collin.funk1@gmail.com
Sun Oct 12 02:10:13 GMT 2025
Bruno Haible <bruno@clisp.org> writes:
> Adhemerval Zanella Netto wrote:
>> >> There is also https://sourceware.org/bugzilla/show_bug.cgi?id=33537,
>> >
>> > Your fix of [BZ #30635] fixes this one as well, AFAICS from testing within
>> > Gnulib. So, it's the same bug, but you might want to adjust the comment
>> > in posix/glob.c and maybe add a second test case.
>>
>> Hi Bruno, could you mark the bug as duplicate then?
>
> I'll gladly do that when the test case has been added to glibc's test suite.
>
> (I don't see a way in bugzilla to mark a bug as a duplicate without moving
> it to "resolved" state. And I don't like to mark bugs as "resolved" before
> they have been fully handled.)
I agree with adding it to the test suite, especially since it is only a
few extra lines to cover this one as well. :)
Done with the v3 patch [1]. I've confirmed that my patch fixes this
case.
I'll also add the test case to my Gnulib patch [2]. I don't think it is
impossible that another implementation has a bug like this, so that will
let us catch it, if it ever occurs.
Collin
[1] https://inbox.sourceware.org/libc-alpha/14f7e5eadb70185317c62a76d5b9656ad0248167.1760234415.git.collin.funk1@gmail.com/T/#u
[2] https://lists.gnu.org/archive/html/bug-gnulib/2025-10/msg00020.html
More information about the Libc-alpha
mailing list