From 2240199dbf6dd66eaada95ffdb021c844bc23c12 Mon Sep 17 00:00:00 2001 From: Nicholas Marriott Date: Wed, 28 Apr 2010 18:19:16 +0000 Subject: [PATCH] Fix crash when resizing in copy mode, when cursor can end up outside screen. Reported by Romain Francois, fixed by Micah Cowan. --- window-copy.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/window-copy.c b/window-copy.c index bb0e81c5..5e04f34e 100644 --- a/window-copy.c +++ b/window-copy.c @@ -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);