summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authornicm <nicm@openbsd.org>2020-10-30 11:34:13 +0000
committernicm <nicm@openbsd.org>2020-10-30 11:34:13 +0000
commit4d4cc167ec077049d1a437b37e8e02f9d791d3f9 (patch)
tree797c802ea4b44c67ff3a3ee5d691e7cb34a9a0b8
parentDo not leak path when freeing screen, from Sergey Nizovtsev. (diff)
downloadwireguard-openbsd-4d4cc167ec077049d1a437b37e8e02f9d791d3f9.tar.xz
wireguard-openbsd-4d4cc167ec077049d1a437b37e8e02f9d791d3f9.zip
Limit range of repeat to avoid silly high numbers causing delays, from
Sergey Nizovtsev.
-rw-r--r--usr.bin/tmux/input.c6
1 files changed, 5 insertions, 1 deletions
diff --git a/usr.bin/tmux/input.c b/usr.bin/tmux/input.c
index 8f1e2f951a7..5b427b78046 100644
--- a/usr.bin/tmux/input.c
+++ b/usr.bin/tmux/input.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: input.c,v 1.184 2020/10/29 16:33:01 nicm Exp $ */
+/* $OpenBSD: input.c,v 1.185 2020/10/30 11:34:13 nicm Exp $ */
/*
* Copyright (c) 2007 Nicholas Marriott <nicholas.marriott@gmail.com>
@@ -1545,6 +1545,10 @@ input_csi_dispatch(struct input_ctx *ictx)
if (n == -1)
break;
+ m = screen_size_x(s) - s->cx;
+ if (n > m)
+ n = m;
+
if (ictx->last == -1)
break;
ictx->ch = ictx->last;