summaryrefslogtreecommitdiffstats
path: root/usr.sbin/mailwrapper/mailwrapper.c
diff options
context:
space:
mode:
Diffstat (limited to 'usr.sbin/mailwrapper/mailwrapper.c')
-rw-r--r--usr.sbin/mailwrapper/mailwrapper.c8
1 files changed, 4 insertions, 4 deletions
diff --git a/usr.sbin/mailwrapper/mailwrapper.c b/usr.sbin/mailwrapper/mailwrapper.c
index d696d25..1b52a64 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.18 2007/11/06 14:39:19 otto Exp $ */
/* $NetBSD: mailwrapper.c,v 1.9 2003/03/09 08:10:43 mjl Exp $ */
/*
@@ -61,8 +61,8 @@ initarg(struct arglist *al)
{
al->argc = 0;
al->maxc = 10;
- if ((al->argv = malloc(al->maxc * sizeof(char *))) == NULL)
- err(EX_TEMPFAIL, "malloc");
+ if ((al->argv = calloc(al->maxc, sizeof(char *))) == NULL)
+ err(EX_TEMPFAIL, "calloc");
}
static void
@@ -126,7 +126,7 @@ main(int argc, char *argv[], char *envp[])
continue;
}
- if ((from = strsep(&cp, WS)) == NULL)
+ if ((from = strsep(&cp, WS)) == NULL || cp == NULL)
goto parse_error;
cp += strspn(cp, WS);
OpenPOWER on IntegriCloud