From: Thomas Weißschuh Date: Tue, 12 Sep 2023 22:25:36 +0000 (+0200) Subject: more: remove usage of alloca() X-Git-Tag: v2.40-rc1~246^2~1 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=c988ccdcdb5a51134af51f06371e6dd26a9e271f;p=thirdparty%2Futil-linux.git more: remove usage of alloca() alloca() is susceptible to security issues, avoid it. Signed-off-by: Thomas Weißschuh --- diff --git a/text-utils/more.c b/text-utils/more.c index 0a13b42438..6026695fbc 100644 --- a/text-utils/more.c +++ b/text-utils/more.c @@ -1253,8 +1253,7 @@ static void __attribute__((__format__ (__printf__, 3, 4))) } va_end(argp); - args = alloca(sizeof(char *) * (argcount + 1)); - args[argcount] = NULL; + args = xcalloc(argcount + 1, sizeof(char *)); va_start(argp, cmd); arg = va_arg(argp, char *);