mirror of
https://github.com/tmate-io/tmate.git
synced 2025-08-09 05:54:47 +02:00
Give each paste buffer a size member instead of requiring them to be
zero-terminated.
This commit is contained in:
@ -18,7 +18,6 @@
|
||||
|
||||
#include <sys/types.h>
|
||||
|
||||
#include <string.h>
|
||||
#include <vis.h>
|
||||
|
||||
#include "tmux.h"
|
||||
@ -65,7 +64,7 @@ cmd_show_buffer_exec(struct cmd *self, struct cmd_ctx *ctx)
|
||||
if (pb == NULL)
|
||||
return (0);
|
||||
|
||||
size = strlen(pb->data);
|
||||
size = pb->size;
|
||||
if (size > SIZE_MAX / 4 - 1)
|
||||
size = SIZE_MAX / 4 - 1;
|
||||
in = xmalloc(size * 4 + 1);
|
||||
|
Reference in New Issue
Block a user