[PATCH 5/6] posix: Remove the alloca uses from glob_in_dir
Adhemerval Zanella Netto
adhemerval.zanella@linaro.org
Fri Aug 7 13:14:37 GMT 2026
On 07/08/26 01:38, Collin Funk wrote:
> Adhemerval Zanella <adhemerval.zanella@linaro.org> writes:
>
>> What is left are the name used to stat a component without
>> metacharacters and the blocks holding the matched names. With those on
>> the heap the alloca budget can go as well.
>>
>> Also treat the size overflow as an error. It used to fall through
>> to malloc with the wrapped size and then copy the full length
>> into it.
>>
>> alloca is now used only by the MSDOS and Windows paths, which glibc
>> does not build, so move its header out of the way as well.
>>
>> Checked on x86_64-linux-gnu, aarch64-linux-gnu, and i686-linux-gnu.
>> ---
>> posix/glob.c | 68 +++++++++++++---------------------------------------
>> 1 file changed, 17 insertions(+), 51 deletions(-)
>
> This one looks good as well. I'll review the last patch tomorrow.
Thanks Collin!
>
> Reviewed-by: Collin Funk <collin.funk1@gmail.com>
>
> Collin
More information about the Libc-alpha
mailing list