The branch, master has been updated via 26c42ad1e4bf8db443c5e2cbb14c0b82329a6137 (commit) from 77603c4f2de1961b3da141b3e6e4ce2f983365d4 (commit)
- Log ----------------------------------------------------------------- commit 26c42ad1e4bf8db443c5e2cbb14c0b82329a6137 Author: Nicholas Marriott <nicholas.marri...@gmail.com> Commit: Nicholas Marriott <nicholas.marri...@gmail.com> Don't crash with a zero-length argument to setb, from J Raynor. --- cmd-set-buffer.c | 5 +++-- 1 files changed, 3 insertions(+), 2 deletions(-) diff --git a/cmd-set-buffer.c b/cmd-set-buffer.c index 0e754bb..e7f9b95 100644 --- a/cmd-set-buffer.c +++ b/cmd-set-buffer.c @@ -56,6 +56,9 @@ cmd_set_buffer_exec(struct cmd *self, struct cmd_q *cmdq) pb = NULL; buffer = -1; + if ((newsize = strlen(args->argv[0])) == 0) + return (CMD_RETURN_NORMAL); + if (args_has(args, 'b')) { buffer = args_strtonum(args, 'b', 0, INT_MAX, &cause); if (cause != NULL) { @@ -80,8 +83,6 @@ cmd_set_buffer_exec(struct cmd *self, struct cmd_q *cmdq) memcpy(pdata, pb->data, psize); } - newsize = strlen(args->argv[0]); - pdata = xrealloc(pdata, 1, psize + newsize); memcpy(pdata + psize, args->argv[0], newsize); psize += newsize; ----------------------------------------------------------------------- Summary of changes: cmd-set-buffer.c | 5 +++-- 1 files changed, 3 insertions(+), 2 deletions(-) hooks/post-receive -- tmux ------------------------------------------------------------------------------ Learn Graph Databases - Download FREE O'Reilly Book "Graph Databases" is the definitive new guide to graph databases and their applications. Written by three acclaimed leaders in the field, this first edition is now available. Download your free book today! http://p.sf.net/sfu/13534_NeoTech _______________________________________________ tmux-cvs mailing list tmux-cvs@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/tmux-cvs