summaryrefslogtreecommitdiff
path: root/usr.bin
diff options
context:
space:
mode:
authorNicholas Marriott <nicm@cvs.openbsd.org>2021-10-21 08:36:52 +0000
committerNicholas Marriott <nicm@cvs.openbsd.org>2021-10-21 08:36:52 +0000
commit6465726c19e681b39038f9626fd2b191c8c831da (patch)
treec7d52926817c8281b7fbbca5b345894166f48829 /usr.bin
parentaa043a660187aed86703938a6209c25eed4d4054 (diff)
Correctly adjust the end pointer for a two character terminator before
decoding OSC 52 response, from Daniel Ekloef in GitHub issue 2942.
Diffstat (limited to 'usr.bin')
-rw-r--r--usr.bin/tmux/tty-keys.c5
1 files changed, 4 insertions, 1 deletions
diff --git a/usr.bin/tmux/tty-keys.c b/usr.bin/tmux/tty-keys.c
index 03853dcbb98..f01ab9a2407 100644
--- a/usr.bin/tmux/tty-keys.c
+++ b/usr.bin/tmux/tty-keys.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: tty-keys.c,v 1.150 2021/08/13 07:37:58 nicm Exp $ */
+/* $OpenBSD: tty-keys.c,v 1.151 2021/10/21 08:36:51 nicm Exp $ */
/*
* Copyright (c) 2007 Nicholas Marriott <nicholas.marriott@gmail.com>
@@ -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++;