From 62aa42aabbbae99712326811e9522577486b3466 Mon Sep 17 00:00:00 2001 From: Theo de Raadt Date: Wed, 8 Oct 2014 05:28:20 +0000 Subject: obvious reallocarray(); ok doug --- lib/libc/stdio/open_wmemstream.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'lib/libc') diff --git a/lib/libc/stdio/open_wmemstream.c b/lib/libc/stdio/open_wmemstream.c index 94141878fdd..391a944456f 100644 --- a/lib/libc/stdio/open_wmemstream.c +++ b/lib/libc/stdio/open_wmemstream.c @@ -1,4 +1,4 @@ -/* $OpenBSD: open_wmemstream.c,v 1.3 2014/03/06 07:28:21 gerhard Exp $ */ +/* $OpenBSD: open_wmemstream.c,v 1.4 2014/10/08 05:28:19 deraadt Exp $ */ /* * Copyright (c) 2011 Martin Pieuchot @@ -52,7 +52,7 @@ wmemstream_write(void *v, const char *b, int l) if (sz < end + 1) sz = end + 1; - p = realloc(st->string, sz * sizeof(wchar_t)); + p = reallocarray(st->string, sz, sizeof(wchar_t)); if (!p) return (-1); bzero(p + st->size, (sz - st->size) * sizeof(wchar_t)); -- cgit v1.2.3