]> git.ipfire.org Git - thirdparty/openembedded/openembedded-core-contrib.git/commitdiff
less: backport the fix for CVE-2022-46663
authorRoss Burton <ross.burton@arm.com>
Mon, 20 Feb 2023 16:28:15 +0000 (16:28 +0000)
committerRichard Purdie <richard.purdie@linuxfoundation.org>
Fri, 24 Feb 2023 11:03:45 +0000 (11:03 +0000)
Signed-off-by: Ross Burton <ross.burton@arm.com>
Signed-off-by: Alexandre Belloni <alexandre.belloni@bootlin.com>
meta/recipes-extended/less/files/CVE-2022-46663.patch [new file with mode: 0644]
meta/recipes-extended/less/less_608.bb

diff --git a/meta/recipes-extended/less/files/CVE-2022-46663.patch b/meta/recipes-extended/less/files/CVE-2022-46663.patch
new file mode 100644 (file)
index 0000000..20f9d89
--- /dev/null
@@ -0,0 +1,28 @@
+CVE: CVE-2022-46663
+Upstream-Status: Backport
+Signed-off-by: Ross Burton <ross.burton@arm.com>
+
+From a78e1351113cef564d790a730d657a321624d79c Mon Sep 17 00:00:00 2001
+From: Mark Nudelman <markn@greenwoodsoftware.com>
+Date: Fri, 7 Oct 2022 19:25:46 -0700
+Subject: [PATCH] End OSC8 hyperlink on invalid embedded escape sequence.
+
+---
+ line.c | 4 ++--
+ 1 file changed, 2 insertions(+), 2 deletions(-)
+
+diff --git a/line.c b/line.c
+index 236c49ae..cba7bdd1 100644
+--- a/line.c
++++ b/line.c
+@@ -633,8 +633,8 @@ ansi_step(pansi, ch)
+               /* Hyperlink ends with \7 or ESC-backslash. */
+               if (ch == '\7')
+                       return ANSI_END;
+-              if (pansi->prev_esc && ch == '\\')
+-                      return ANSI_END;
++              if (pansi->prev_esc)
++            return (ch == '\\') ? ANSI_END : ANSI_ERR;
+               pansi->prev_esc = (ch == ESC);
+               return ANSI_MID;
+       }
index f411a8fb53f658b59883a5a1f49cb6c7787744ae..f907a8159ccf73b4a1d1a253c20f17618d55f54e 100644 (file)
@@ -26,6 +26,7 @@ LIC_FILES_CHKSUM = "file://COPYING;md5=1ebbd3e34237af26da5dc08a4e440464 \
 DEPENDS = "ncurses"
 
 SRC_URI = "http://www.greenwoodsoftware.com/${BPN}/${BPN}-${PV}.tar.gz \
+           file://CVE-2022-46663.patch \
          "
 
 SRC_URI[sha256sum] = "a69abe2e0a126777e021d3b73aa3222e1b261f10e64624d41ec079685a6ac209"