mirror of
https://github.com/tmate-io/tmate.git
synced 2025-06-30 06:10:46 +02: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: cmd-paste-buffer.c,v 1.15 2009-01-19 18:23:40 nicm Exp $ */
|
||||
/* $Id: cmd-paste-buffer.c,v 1.16 2009-07-02 16:23:54 nicm Exp $ */
|
||||
|
||||
/*
|
||||
* Copyright (c) 2007 Nicholas Marriott <nicm@users.sourceforge.net>
|
||||
@ -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. */
|
||||
|
Reference in New Issue
Block a user