summaryrefslogtreecommitdiffstats
path: root/lib/libc/string/wcsdup.c
diff options
context:
space:
mode:
authorderaadt <deraadt@openbsd.org>2014-10-08 05:27:17 +0000
committerderaadt <deraadt@openbsd.org>2014-10-08 05:27:17 +0000
commit814699410879c4708270b7ece571d61895612565 (patch)
tree5d252887664b486448f122c45bffc43fccc016a9 /lib/libc/string/wcsdup.c
parentRemove the i830/i845 pipe A force quirks, matching changes (diff)
downloadwireguard-openbsd-814699410879c4708270b7ece571d61895612565.tar.xz
wireguard-openbsd-814699410879c4708270b7ece571d61895612565.zip
obvious malloc -> reallocarray, for mult int oflow
Diffstat (limited to 'lib/libc/string/wcsdup.c')
-rw-r--r--lib/libc/string/wcsdup.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/lib/libc/string/wcsdup.c b/lib/libc/string/wcsdup.c
index 57a328a8c2b..085d1c445d9 100644
--- a/lib/libc/string/wcsdup.c
+++ b/lib/libc/string/wcsdup.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: wcsdup.c,v 1.1 2011/07/04 04:37:34 nicm Exp $ */
+/* $OpenBSD: wcsdup.c,v 1.2 2014/10/08 05:27:17 deraadt Exp $ */
/* $NetBSD: wcsdup.c,v 1.3 2008/05/26 13:17:48 haad Exp $ */
/*
@@ -22,7 +22,7 @@ wcsdup(const wchar_t *str)
size_t len;
len = wcslen(str) + 1;
- copy = malloc(len * sizeof (wchar_t));
+ copy = reallocarray(NULL, len, sizeof(wchar_t));
if (!copy)
return (NULL);