aboutsummaryrefslogtreecommitdiff
path: root/window-copy.c
diff options
context:
space:
mode:
authorNicholas Marriott <nicm@openbsd.org>2009-07-02 16:15:43 +0000
committerNicholas Marriott <nicm@openbsd.org>2009-07-02 16:15:43 +0000
commitfe5edad1fcd60d94bc45ca49f94636eeecae210d (patch)
tree2ddba8ad9cd1b87903c6cbecee01cf8b92846a6f /window-copy.c
parent4c5c125173e07dcc061aa162b08d1722c73abe7d (diff)
downloadrtmux-fe5edad1fcd60d94bc45ca49f94636eeecae210d.tar.gz
rtmux-fe5edad1fcd60d94bc45ca49f94636eeecae210d.tar.bz2
rtmux-fe5edad1fcd60d94bc45ca49f94636eeecae210d.zip
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. ok sthen "put it in" deraadt
Diffstat (limited to 'window-copy.c')
-rw-r--r--window-copy.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/window-copy.c b/window-copy.c
index dc2a4d45..a64be760 100644
--- a/window-copy.c
+++ b/window-copy.c
@@ -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 {