From dc2a3eec17637007f91dffacd15a964e6d94ca50 Mon Sep 17 00:00:00 2001 From: Mattias Andrée Date: Sat, 17 Apr 2021 13:13:59 +0200 Subject: Reject surrogates in CSI u MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Mattias Andrée --- libterminput.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'libterminput.c') diff --git a/libterminput.c b/libterminput.c index 81656aa..136f898 100644 --- a/libterminput.c +++ b/libterminput.c @@ -467,7 +467,7 @@ parse_sequence(union libterminput_input *input, struct libterminput_state *ctx) input->mouseevent.y = (size_t)nums[1] + (size_t)!nums[1]; break; case 'u': - if (nums[0] > 0x10FFFFULL) { + if (nums[0] > 0x10FFFFULL || (nums[0] & 0xD800) == 0xD800) { input->type = LIBTERMINPUT_NONE; break; } -- cgit v1.2.3-70-g09d2