summaryrefslogtreecommitdiffstats
path: root/usr.bin/tmux/paste.c
diff options
context:
space:
mode:
authornicm <nicm@openbsd.org>2014-10-08 17:14:04 +0000
committernicm <nicm@openbsd.org>2014-10-08 17:14:04 +0000
commit29c26c2a73763c869f9c2012db259ade8cbb5bf9 (patch)
treedb837cac7f7ecffad0f09d81f01d3216b451b12f /usr.bin/tmux/paste.c
parentcheck audio parameters returned by the audio drivers, (diff)
downloadwireguard-openbsd-29c26c2a73763c869f9c2012db259ade8cbb5bf9.tar.xz
wireguard-openbsd-29c26c2a73763c869f9c2012db259ade8cbb5bf9.zip
Use xrealloc(NULL, n, m) instead of xmalloc(n * m) to get overflow
check.
Diffstat (limited to 'usr.bin/tmux/paste.c')
-rw-r--r--usr.bin/tmux/paste.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/usr.bin/tmux/paste.c b/usr.bin/tmux/paste.c
index 05b421cae22..88e03159d0a 100644
--- a/usr.bin/tmux/paste.c
+++ b/usr.bin/tmux/paste.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: paste.c,v 1.23 2014/09/01 21:50:18 nicm Exp $ */
+/* $OpenBSD: paste.c,v 1.24 2014/10/08 17:14:04 nicm Exp $ */
/*
* Copyright (c) 2007 Nicholas Marriott <nicm@users.sourceforge.net>
@@ -279,7 +279,7 @@ paste_make_sample(struct paste_buffer *pb, int utf8flag)
len = pb->size;
if (len > width)
len = width;
- buf = xmalloc(len * 4 + 4);
+ buf = xrealloc(NULL, len, 4 + 4);
if (utf8flag)
used = utf8_strvis(buf, pb->data, len, flags);