less/less-590-CVE-2022-46663.patch
Matej Mužila 09fb5329e2 Fix CVE-2022-46663
Resolves: CVE-2022-46663
2023-04-20 15:34:25 +02:00

22 lines
613 B
Diff

commit a78e1351113cef564d790a730d657a321624d79c
Author: Mark Nudelman <markn@greenwoodsoftware.com>
Date: Fri Oct 7 19:25:46 2022 -0700
End OSC8 hyperlink on invalid embedded escape sequence.
diff --git a/line.c b/line.c
index 236c49a..cba7bdd 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;
}