mirror of
https://github.com/tmux/tmux.git
synced 2025-09-03 14:27:09 +00:00
Fix two copy/paste bugs: forbid zero-length buffers to prevent a fatal error
when trying to paste them, found by me, and miscalculation of the start/end causing random fatal errors when copying in copy-mode, reported by sthen.
This commit is contained in:
@ -1,4 +1,4 @@
|
||||
/* $Id: window-copy.c,v 1.60 2009-05-04 17:58:27 nicm Exp $ */
|
||||
/* $Id: window-copy.c,v 1.61 2009-07-02 16:23:54 nicm Exp $ */
|
||||
|
||||
/*
|
||||
* Copyright (c) 2007 Nicholas Marriott <nicm@users.sourceforge.net>
|
||||
@ -423,7 +423,7 @@ window_copy_copy_selection(struct window_pane *wp, struct client *c)
|
||||
/* Find start and end. */
|
||||
xx = data->cx + data->ox;
|
||||
yy = screen_hsize(&wp->base) + data->cy - data->oy;
|
||||
if (xx < data->selx || (yy == data->sely && xx < data->selx)) {
|
||||
if (yy < data->sely || (yy == data->sely && xx < data->selx)) {
|
||||
sx = xx; sy = yy;
|
||||
ex = data->selx; ey = data->sely;
|
||||
} else {
|
||||
|
Reference in New Issue
Block a user