diff options
author | Nicholas Marriott <nicm@openbsd.org> | 2009-07-02 16:15:43 +0000 |
---|---|---|
committer | Nicholas Marriott <nicm@openbsd.org> | 2009-07-02 16:15:43 +0000 |
commit | fe5edad1fcd60d94bc45ca49f94636eeecae210d (patch) | |
tree | 2ddba8ad9cd1b87903c6cbecee01cf8b92846a6f /cmd-paste-buffer.c | |
parent | 4c5c125173e07dcc061aa162b08d1722c73abe7d (diff) | |
download | rtmux-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 'cmd-paste-buffer.c')
-rw-r--r-- | cmd-paste-buffer.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/cmd-paste-buffer.c b/cmd-paste-buffer.c index 35472d3d..3f4cfe2e 100644 --- a/cmd-paste-buffer.c +++ b/cmd-paste-buffer.c @@ -63,7 +63,7 @@ cmd_paste_buffer_exec(struct cmd *self, struct cmd_ctx *ctx) } } - if (pb != NULL) + if (pb != NULL && *pb->data != '\0') buffer_write(w->active->out, pb->data, strlen(pb->data)); /* Delete the buffer if -d. */ |