From 289ac55ebde18df237ad21734ba4056896d11022 Mon Sep 17 00:00:00 2001 From: nicm Date: Thu, 21 Oct 2021 08:36:51 +0000 Subject: Correctly adjust the end pointer for a two character terminator before decoding OSC 52 response, from Daniel Ekloef in GitHub issue 2942. --- tty-keys.c | 3 +++ 1 file changed, 3 insertions(+) (limited to 'tty-keys.c') diff --git a/tty-keys.c b/tty-keys.c index 6dfa70f3..65b600c0 100644 --- a/tty-keys.c +++ b/tty-keys.c @@ -1204,6 +1204,9 @@ tty_keys_clipboard(__unused struct tty *tty, const char *buf, size_t len, buf += 5; end -= 5; + /* Adjust end so that it points to the start of the terminator. */ + end -= terminator - 1; + /* Get the second argument. */ while (end != 0 && *buf != ';') { buf++; -- cgit