summaryrefslogtreecommitdiffstats
path: root/usr.bin/tmux/cmd-set-buffer.c
diff options
context:
space:
mode:
authornicm <nicm@openbsd.org>2014-10-08 17:35:58 +0000
committernicm <nicm@openbsd.org>2014-10-08 17:35:58 +0000
commit64cf113cfda174a3f12284d623b95b76b54db679 (patch)
treef03be81fb0b9ec2b0468ad2d40689ed61b83a2c5 /usr.bin/tmux/cmd-set-buffer.c
parentUse xrealloc(NULL, n, m) instead of xmalloc(n * m) to get overflow (diff)
downloadwireguard-openbsd-64cf113cfda174a3f12284d623b95b76b54db679.tar.xz
wireguard-openbsd-64cf113cfda174a3f12284d623b95b76b54db679.zip
Add xreallocarray and remove nmemb argument from xrealloc.
Diffstat (limited to 'usr.bin/tmux/cmd-set-buffer.c')
-rw-r--r--usr.bin/tmux/cmd-set-buffer.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/usr.bin/tmux/cmd-set-buffer.c b/usr.bin/tmux/cmd-set-buffer.c
index e80727899df..0f5d4e995b6 100644
--- a/usr.bin/tmux/cmd-set-buffer.c
+++ b/usr.bin/tmux/cmd-set-buffer.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: cmd-set-buffer.c,v 1.18 2014/05/13 07:34:35 nicm Exp $ */
+/* $OpenBSD: cmd-set-buffer.c,v 1.19 2014/10/08 17:35:58 nicm Exp $ */
/*
* Copyright (c) 2007 Nicholas Marriott <nicm@users.sourceforge.net>
@@ -104,7 +104,7 @@ cmd_set_buffer_exec(struct cmd *self, struct cmd_q *cmdq)
memcpy(pdata, pb->data, psize);
}
- pdata = xrealloc(pdata, 1, psize + newsize);
+ pdata = xrealloc(pdata, psize + newsize);
memcpy(pdata + psize, args->argv[0], newsize);
psize += newsize;