summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--lib/libevent/buffer.c5
1 files changed, 3 insertions, 2 deletions
diff --git a/lib/libevent/buffer.c b/lib/libevent/buffer.c
index 14f0cd9762b..79b6da3727b 100644
--- a/lib/libevent/buffer.c
+++ b/lib/libevent/buffer.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: buffer.c,v 1.30 2016/09/03 11:31:17 nayden Exp $ */
+/* $OpenBSD: buffer.c,v 1.31 2017/03/18 01:48:43 deraadt Exp $ */
/*
* Copyright (c) 2002, 2003 Niels Provos <provos@citi.umich.edu>
@@ -359,7 +359,8 @@ evbuffer_expand(struct evbuffer *buf, size_t datlen)
if (buf->orig_buffer != buf->buffer)
evbuffer_align(buf);
- if ((newbuf = realloc(buf->buffer, length)) == NULL)
+ if ((newbuf = recallocarray(buf->buffer, buf->totallen,
+ length, 1)) == NULL)
return (-1);
buf->orig_buffer = buf->buffer = newbuf;