summaryrefslogtreecommitdiffstats
path: root/usr.sbin/zdump/zdump.c
diff options
context:
space:
mode:
authorderaadt <deraadt@openbsd.org>2015-02-10 22:44:29 +0000
committerderaadt <deraadt@openbsd.org>2015-02-10 22:44:29 +0000
commit753cfe0cc28249bab76db35f800c37becd8a19e3 (patch)
treee9a6094a925e63c37945978cf0fd66dc325ec48a /usr.sbin/zdump/zdump.c
parentConvert to uiomove(). (diff)
downloadwireguard-openbsd-753cfe0cc28249bab76db35f800c37becd8a19e3.tar.xz
wireguard-openbsd-753cfe0cc28249bab76db35f800c37becd8a19e3.zip
pounce on a reallocarray opportunity before tedu
Diffstat (limited to 'usr.sbin/zdump/zdump.c')
-rw-r--r--usr.sbin/zdump/zdump.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/usr.sbin/zdump/zdump.c b/usr.sbin/zdump/zdump.c
index 93df1985039..081300df532 100644
--- a/usr.sbin/zdump/zdump.c
+++ b/usr.sbin/zdump/zdump.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: zdump.c,v 1.8 2015/02/09 23:14:32 tedu Exp $ */
+/* $OpenBSD: zdump.c,v 1.9 2015/02/10 22:44:29 deraadt Exp $ */
/*
** This file is in the public domain, so clarified as of
** 2009-05-17 by Arthur David Olson.
@@ -258,7 +258,7 @@ char * argv[];
for (i = 0; environ[i] != NULL; ++i)
continue;
- fakeenv = malloc((size_t) ((i + 2) * sizeof *fakeenv));
+ fakeenv = reallocarray(NULL, i + 2, sizeof *fakeenv);
if (fakeenv == NULL ||
(fakeenv[0] = malloc(longest + 4)) == NULL) {
perror(progname);