From: Karel Zak Date: Thu, 21 Mar 2024 10:16:20 +0000 (+0100) Subject: wall: fix escape sequence Injection [CVE-2024-28085] X-Git-Tag: v2.42-start~469 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=f4f0782f66692112311659086fd552d40d7a6f59;p=thirdparty%2Futil-linux.git wall: fix escape sequence Injection [CVE-2024-28085] Let's use for all cases the same output function. Reported-by: Skyler Ferrante Signed-off-by: Karel Zak (cherry picked from commit 404b0781f52f7c045ca811b2dceec526408ac253) --- diff --git a/term-utils/wall.c b/term-utils/wall.c index f894a32f8..588d3a963 100644 --- a/term-utils/wall.c +++ b/term-utils/wall.c @@ -368,7 +368,7 @@ static char *makemsg(char *fname, char **mvec, int mvecsz, int i; for (i = 0; i < mvecsz; i++) { - fputs(mvec[i], fs); + fputs_careful(mvec[i], fs, '^', true, TERM_WIDTH); if (i < mvecsz - 1) fputc(' ', fs); }