diff options
author | 2014-10-08 05:28:19 +0000 | |
---|---|---|
committer | 2014-10-08 05:28:19 +0000 | |
commit | 13074ba5d85df140d75da4e5780fe3abc6d8ea7d (patch) | |
tree | 9d8ba28af7921da6962dd3a80513047a8a8d1f0e /lib/libc/stdio/open_wmemstream.c | |
parent | obvious malloc -> reallocarray, for mult int oflow (diff) | |
download | wireguard-openbsd-13074ba5d85df140d75da4e5780fe3abc6d8ea7d.tar.xz wireguard-openbsd-13074ba5d85df140d75da4e5780fe3abc6d8ea7d.zip |
obvious reallocarray(); ok doug
Diffstat (limited to 'lib/libc/stdio/open_wmemstream.c')
-rw-r--r-- | lib/libc/stdio/open_wmemstream.c | 4 |
1 files changed, 2 insertions, 2 deletions
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 <mpi@openbsd.org> @@ -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)); |