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.39.4~10 X-Git-Url: http://git.ipfire.org/gitweb/gitweb.cgi?a=commitdiff_plain;h=a98558aef1e347adba2cb0028c036ce156aa68a7;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 377db45183..1e7e9abc42 100644 --- a/term-utils/wall.c +++ b/term-utils/wall.c @@ -328,7 +328,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); }