From 40d4efd2162e645207c97bbc815e8004d809a3b3 Mon Sep 17 00:00:00 2001 From: deraadt <> Date: Wed, 8 Oct 2014 05:27:17 +0000 Subject: [PATCH] obvious malloc -> reallocarray, for mult int oflow --- src/lib/libc/string/wcsdup.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/lib/libc/string/wcsdup.c b/src/lib/libc/string/wcsdup.c index 57a328a8..085d1c44 100644 --- a/src/lib/libc/string/wcsdup.c +++ b/src/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);