summaryrefslogtreecommitdiff
path: root/sys-apps/util-linux/files/util-linux-2.39.3-CVE-2024-28085.patch
blob: 99092c05aa7e9ccc6455709cfc5b9a45c05df4ac (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
https://bugs.gentoo.org/927980
https://people.rit.edu/sjf5462/6831711781/wall_2_27_2024.txt
https://github.com/util-linux/util-linux/commit/404b0781f52f7c045ca811b2dceec526408ac253

From 404b0781f52f7c045ca811b2dceec526408ac253 Mon Sep 17 00:00:00 2001
From: Karel Zak <kzak@redhat.com>
Date: Thu, 21 Mar 2024 11:16:20 +0100
Subject: [PATCH] wall: fix escape sequence Injection [CVE-2024-28085]

Let's use for all cases the same output function.

Reported-by: Skyler Ferrante <sjf5462@rit.edu>
Signed-off-by: Karel Zak <kzak@redhat.com>
--- 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);
 		}