diff options
author | 2016-03-02 15:33:36 +0000 | |
---|---|---|
committer | 2016-03-02 15:33:36 +0000 | |
commit | 5b14d177f6dea6a5fd87c241df93ee4e965765d0 (patch) | |
tree | bc66dc8f8ab8e319c0f32bbb71c016a22746d580 /usr.bin/tmux/input-keys.c | |
parent | Disentangle the Zaurus bootstrap from compat/linux and move the (diff) | |
download | wireguard-openbsd-5b14d177f6dea6a5fd87c241df93ee4e965765d0.tar.xz wireguard-openbsd-5b14d177f6dea6a5fd87c241df93ee4e965765d0.zip |
Limit x, y and b to 0x7ff for UTF-8 mouse input, suggested by schwarze@.
Diffstat (limited to 'usr.bin/tmux/input-keys.c')
-rw-r--r-- | usr.bin/tmux/input-keys.c | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/usr.bin/tmux/input-keys.c b/usr.bin/tmux/input-keys.c index 854be5ad18d..c56b3167931 100644 --- a/usr.bin/tmux/input-keys.c +++ b/usr.bin/tmux/input-keys.c @@ -1,4 +1,4 @@ -/* $OpenBSD: input-keys.c,v 1.54 2016/03/01 12:02:08 nicm Exp $ */ +/* $OpenBSD: input-keys.c,v 1.55 2016/03/02 15:33:36 nicm Exp $ */ /* * Copyright (c) 2007 Nicholas Marriott <nicholas.marriott@gmail.com> @@ -263,6 +263,8 @@ input_key_mouse(struct window_pane *wp, struct mouse_event *m) len = xsnprintf(buf, sizeof buf, "\033[<%u;%u;%u%c", m->sgr_b, x + 1, y + 1, m->sgr_type); } else if (wp->screen->mode & MODE_MOUSE_UTF8) { + if (m->b > 0x7ff - 32 || x > 0x7ff - 33 || y > 0x7ff - 33) + return; len = xsnprintf(buf, sizeof buf, "\033[M"); len += input_split2(m->b + 32, &buf[len]); len += input_split2(x + 33, &buf[len]); |