From c988ccdcdb5a51134af51f06371e6dd26a9e271f Mon Sep 17 00:00:00 2001 From: =?utf8?q?Thomas=20Wei=C3=9Fschuh?= Date: Wed, 13 Sep 2023 00:25:36 +0200 Subject: [PATCH] more: remove usage of alloca() MIME-Version: 1.0 Content-Type: text/plain; charset=utf8 Content-Transfer-Encoding: 8bit alloca() is susceptible to security issues, avoid it. Signed-off-by: Thomas Weißschuh --- text-utils/more.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) 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 *); -- 2.47.3