]> sourceware.org Git - glibc.git/commit
io: nftw/ftw: Fix stack overflow with large nopenfd [BZ #26353]
authorXiaoming Ni <nixiaoming@huawei.com>
Thu, 26 Nov 2020 16:35:10 +0000 (13:35 -0300)
committerAdhemerval Zanella <adhemerval.zanella@linaro.org>
Thu, 26 Nov 2020 20:35:58 +0000 (17:35 -0300)
commit106ff08526d3ca574ba86d891450ea55aa929712
treebdf0f8a9fee37a63ce497ccdce712711023f7a61
parentdb07fae8250401adb2b97ab3e53d41da2a6bd767
io: nftw/ftw: Fix stack overflow with large nopenfd [BZ #26353]

The nopenfd value is used as argument for the internal buffer on
ftw_statup, which is allocated with alloca and might trigger
a stack overflow for large values.  This patch replaces the memory
allocation to use malloc instead.

Checked on x86_64-linux-gnu.

Reviewed-by: Adhemerval Zanella <adhemerval.zanella@linaro.org>
io/Makefile
io/ftw.c
io/tst-ftw-bz26353.c [new file with mode: 0644]
This page took 0.039731 seconds and 5 git commands to generate.