summaryrefslogtreecommitdiff
path: root/usr.bin/tmux
diff options
context:
space:
mode:
authorNicholas Marriott <nicm@cvs.openbsd.org>2010-04-28 18:19:17 +0000
committerNicholas Marriott <nicm@cvs.openbsd.org>2010-04-28 18:19:17 +0000
commit610e5005680d7817cab1947389148a2e30a59239 (patch)
tree7b7f0397bf4ee6f524b9392f7513efb1b94157c4 /usr.bin/tmux
parent8f313cebe943aa406956824845bebd8690cb10d9 (diff)
Fix crash when resizing in copy mode, when cursor can end up outside screen.
Reported by Romain Francois, fixed by Micah Cowan.
Diffstat (limited to 'usr.bin/tmux')
-rw-r--r--usr.bin/tmux/window-copy.c4
1 files changed, 3 insertions, 1 deletions
diff --git a/usr.bin/tmux/window-copy.c b/usr.bin/tmux/window-copy.c
index f5720e1ff98..b34a691afcc 100644
--- a/usr.bin/tmux/window-copy.c
+++ b/usr.bin/tmux/window-copy.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: window-copy.c,v 1.54 2010/04/06 21:35:44 nicm Exp $ */
+/* $OpenBSD: window-copy.c,v 1.55 2010/04/28 18:19:16 nicm Exp $ */
/*
* Copyright (c) 2007 Nicholas Marriott <nicm@users.sourceforge.net>
@@ -340,6 +340,8 @@ window_copy_resize(struct window_pane *wp, u_int sx, u_int sy)
data->cy = sy - 1;
if (data->cx > sx)
data->cx = sx;
+ if (data->oy > screen_hsize(data->backing))
+ data->oy = screen_hsize(data->backing);
window_copy_clear_selection(wp);