diff options
author | 2010-04-28 18:19:16 +0000 | |
---|---|---|
committer | 2010-04-28 18:19:16 +0000 | |
commit | 41dc6b565be5d364f8a8ed035e82f1a9d4f399b6 (patch) | |
tree | b5eced79a6be7632381865813ae26ce96b558a27 | |
parent | rename BS so we don't collide with the ocurses define, (diff) | |
download | wireguard-openbsd-41dc6b565be5d364f8a8ed035e82f1a9d4f399b6.tar.xz wireguard-openbsd-41dc6b565be5d364f8a8ed035e82f1a9d4f399b6.zip |
Fix crash when resizing in copy mode, when cursor can end up outside screen.
Reported by Romain Francois, fixed by Micah Cowan.
-rw-r--r-- | usr.bin/tmux/window-copy.c | 4 |
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); |