]> git.ipfire.org Git - thirdparty/kmod.git/commit
shared: use memdup over stdndupa
authorEmil Velikov <emil.l.velikov@gmail.com>
Thu, 22 Aug 2024 16:04:21 +0000 (17:04 +0100)
committerLucas De Marchi <lucas.de.marchi@gmail.com>
Mon, 2 Sep 2024 13:55:40 +0000 (08:55 -0500)
commitb27aa3fb5ae55ac2223cd880f7e17bb8abc14e22
tree522e2dd07535a0e708ad64ddbd0db00b837a16bd
parent7a1de13a54ca827e6ba344cc2643e6383fa71726
shared: use memdup over stdndupa

The stdndupa has a couple of gotchas:
 - allocates memory on stack via alloca(3)... where we pass it a
   user-provided string in at least one instance
 - it's a GNU extension missing on musl and bionic

The mkdir_p() function is not a hot path, so using heap allocation is
perfectly fine. Swap the stdndupa for our local helper memdup.

Signed-off-by: Emil Velikov <emil.l.velikov@gmail.com>
Link: https://github.com/kmod-project/kmod/pull/92
Signed-off-by: Lucas De Marchi <lucas.de.marchi@gmail.com>
configure.ac
shared/missing.h
shared/util.c