From b725362b4dad4ca62b7928b9edccff9956c0c1ac Mon Sep 17 00:00:00 2001 From: imp Date: Mon, 10 Jan 2000 01:25:53 +0000 Subject: Fix mysterious sendmail coredump on systems where malloc.conf pointed to a string containign 'J'. o Properly terminate argv list with a NULL entry. o Use warn() to report the exec failure because free could change errno and err would report the wrong reason. o Don't terminate string to err with ':' since this results in two colons. --- usr.sbin/mailwrapper/mailwrapper.c | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) (limited to 'usr.sbin') diff --git a/usr.sbin/mailwrapper/mailwrapper.c b/usr.sbin/mailwrapper/mailwrapper.c index f1ddcdb..536ec71 100644 --- a/usr.sbin/mailwrapper/mailwrapper.c +++ b/usr.sbin/mailwrapper/mailwrapper.c @@ -78,7 +78,7 @@ addarg(al, arg, copy) } if (copy) { if ((al->argv[al->argc++] = strdup(arg)) == NULL) - err(1, "mailwrapper:"); + err(1, "mailwrapper"); } else al->argv[al->argc++] = (char *)arg; } @@ -152,10 +152,12 @@ main(argc, argv, envp) (void)fclose(config); + al.argv[al.argc] = NULL; execve(to, al.argv, envp); + warn("mailwrapper: execing %s", to); freearg(&al, 0); free(line); - err(1, "mailwrapper: execing %s", to); + exit(1); /*NOTREACHED*/ parse_error: freearg(&al, 0); -- cgit v1.1