summaryrefslogtreecommitdiffstats
path: root/usr.sbin/mailwrapper
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 /usr.sbin/mailwrapper
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 'usr.sbin/mailwrapper')
-rw-r--r--usr.sbin/mailwrapper/mailwrapper.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/usr.sbin/mailwrapper/mailwrapper.c b/usr.sbin/mailwrapper/mailwrapper.c
index 121fb0bc926..d8e1deb2319 100644
--- a/usr.sbin/mailwrapper/mailwrapper.c
+++ b/usr.sbin/mailwrapper/mailwrapper.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: mailwrapper.c,v 1.16 2004/07/06 03:38:14 millert Exp $ */
+/* $OpenBSD: mailwrapper.c,v 1.17 2007/09/02 15:19:39 deraadt Exp $ */
/* $NetBSD: mailwrapper.c,v 1.2 1999/02/20 22:10:07 thorpej Exp $ */
/*
@@ -60,7 +60,7 @@ initarg(struct arglist *al)
{
al->argc = 0;
al->maxc = 10;
- if ((al->argv = malloc(al->maxc * sizeof(char *))) == NULL)
+ if ((al->argv = calloc(al->maxc, sizeof(char *))) == NULL)
err(1, "malloc");
}