[PATCH master 1/2] startup: don't read glob_t if glob("/env/init/*") fails
Sascha Hauer
sha at pengutronix.de
Fri Oct 1 06:29:04 PDT 2021
On Wed, Sep 22, 2021 at 09:14:39AM +0200, Ahmad Fatoum wrote:
> globfree() is a no-op if glob_t::gl_pathv is NULL. A failed glob may not
> always initialize this member however, leading to potential memory
> corruption.
>
> Fix this by only freeing the glob_t if glob() had succeeded.
>
> Signed-off-by: Ahmad Fatoum <a.fatoum at pengutronix.de>
> ---
> common/startup.c | 4 ++--
> 1 file changed, 2 insertions(+), 2 deletions(-)
Applied, thanks
Sascha
--
Pengutronix e.K. | |
Steuerwalder Str. 21 | http://www.pengutronix.de/ |
31137 Hildesheim, Germany | Phone: +49-5121-206917-0 |
Amtsgericht Hildesheim, HRA 2686 | Fax: +49-5121-206917-5555 |
More information about the barebox
mailing list