Browse Source

obvious malloc -> reallocarray, for mult int oflow

OPENBSD_5_7
deraadt 10 years ago
parent
commit
40d4efd216
1 changed files with 2 additions and 2 deletions
  1. +2
    -2
      src/lib/libc/string/wcsdup.c

+ 2
- 2
src/lib/libc/string/wcsdup.c View File

@ -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 $ */ /* $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; size_t len;
len = wcslen(str) + 1; len = wcslen(str) + 1;
copy = malloc(len * sizeof (wchar_t));
copy = reallocarray(NULL, len, sizeof(wchar_t));
if (!copy) if (!copy)
return (NULL); return (NULL);


Loading…
Cancel
Save