mirror of
https://github.com/tmate-io/tmate.git
synced 2026-08-01 15:20:02 +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. ok sthen "put it in" deraadt
This commit is contained in:
parent
4c5c125173
commit
fe5edad1fc
3 changed files with 5 additions and 2 deletions
|
|
@ -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. */
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue