[PATCH 5/6] posix: Remove the alloca uses from glob_in_dir
Collin Funk
collin.funk1@gmail.com
Fri Aug 7 04:38:47 GMT 2026
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.
Reviewed-by: Collin Funk <collin.funk1@gmail.com>
Collin
More information about the Libc-alpha
mailing list