Fix crash when resizing in copy mode, when cursor can end up outside screen.

Reported by Romain Francois, fixed by Micah Cowan.
This commit is contained in:
Nicholas Marriott 2010-04-28 18:19:16 +00:00
parent 83e1a33ff5
commit 2240199dbf

View File

@ -340,6 +340,8 @@ window_copy_resize(struct window_pane *wp, u_int sx, u_int sy)
data->cy = sy - 1; data->cy = sy - 1;
if (data->cx > sx) if (data->cx > sx)
data->cx = sx; data->cx = sx;
if (data->oy > screen_hsize(data->backing))
data->oy = screen_hsize(data->backing);
window_copy_clear_selection(wp); window_copy_clear_selection(wp);