[PATCH] posix: Avoid a stack overflow when glob is given many trailing slashes [BZ #30635]
Sam James
sam@gentoo.org
Tue Oct 7 21:48:46 GMT 2025
Collin Funk <collin.funk1@gmail.com> writes:
> Adhemerval Zanella Netto <adhemerval.zanella@linaro.org> writes:
>
>> On 07/10/25 03:15, Collin Funk wrote:
>>> * posix/glob.c (__glob): Strip trailing slashes before the recursive
>>> call, so it is not called for every trailing slash in the pattern.
>>> * posix/tst-glob-bz30635.c: Add a test case that would previously
>>> segmentation fault.
>>> * posix/Makefile (tests): Add the new test.
>>
>> The fix looks ok to me, just a test suggestion below.
>>
>> I am also CC gnulib maintainers, they might also want to fix it on their
>> side as well.
>
> I'm a committer there, so I was going to patch it there after glibc.
Please mention that in future -- both to help people keep in mind it's
part of gnulib, and also so nobody has to ask ;)
More information about the Libc-alpha
mailing list