summaryrefslogtreecommitdiffstats
path: root/bin/systrace/systrace.c
diff options
context:
space:
mode:
authorderaadt <deraadt@openbsd.org>2007-09-02 15:19:07 +0000
committerderaadt <deraadt@openbsd.org>2007-09-02 15:19:07 +0000
commit1ed98fdf61d9dd29369f246109081408082ce54d (patch)
treead7631e58c83830d1fc51cbadb9a2da53c1abfb7 /bin/systrace/systrace.c
parentOpenCVS server init-support with OpenCVS and GNU cvs clients. (diff)
downloadwireguard-openbsd-1ed98fdf61d9dd29369f246109081408082ce54d.tar.xz
wireguard-openbsd-1ed98fdf61d9dd29369f246109081408082ce54d.zip
use calloc() to avoid malloc(n * m) overflows; checked by djm canacar jsg
Diffstat (limited to 'bin/systrace/systrace.c')
-rw-r--r--bin/systrace/systrace.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/bin/systrace/systrace.c b/bin/systrace/systrace.c
index 37a52712f5c..8e2045c564a 100644
--- a/bin/systrace/systrace.c
+++ b/bin/systrace/systrace.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: systrace.c,v 1.54 2006/07/02 12:34:15 sturm Exp $ */
+/* $OpenBSD: systrace.c,v 1.55 2007/09/02 15:19:08 deraadt Exp $ */
/*
* Copyright 2002 Niels Provos <provos@citi.umich.edu>
* All rights reserved.
@@ -754,7 +754,7 @@ main(int argc, char **argv)
if (pidattach == 0) {
/* Run a command and attach to it */
- if ((args = malloc((argc + 1) * sizeof(char *))) == NULL)
+ if ((args = calloc(argc + 1, sizeof(char *))) == NULL)
err(1, "malloc");
for (i = 0; i < argc; i++)