summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorTheo de Raadt <deraadt@cvs.openbsd.org>2015-02-10 22:44:30 +0000
committerTheo de Raadt <deraadt@cvs.openbsd.org>2015-02-10 22:44:30 +0000
commitcedcb61c4089e42a856b6469ce521e060becebc7 (patch)
tree9aa8a9c5ccea3d3264d913fb121e6b74e00dd8fc
parenta88df0b3bb075ba5060ed755522158ca3d4105e9 (diff)
pounce on a reallocarray opportunity before tedu
-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);