Source-Changes-HG archive
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]
[src/netbsd-1-5]: src/usr.sbin/mailwrapper Pull up revision 1.4 (requested by...
details: https://anonhg.NetBSD.org/src/rev/3dc1152a6aeb
branches: netbsd-1-5
changeset: 490599:3dc1152a6aeb
user: he <he%NetBSD.org@localhost>
date: Sat Feb 03 20:27:35 2001 +0000
description:
Pull up revision 1.4 (requested by msaitoh):
Add forgottern addarg(&al, NULL, 0) before execve() to prevent
coredump.
diffstat:
usr.sbin/mailwrapper/mailwrapper.c | 20 ++------------------
1 files changed, 2 insertions(+), 18 deletions(-)
diffs (52 lines):
diff -r dad9c03ea694 -r 3dc1152a6aeb usr.sbin/mailwrapper/mailwrapper.c
--- a/usr.sbin/mailwrapper/mailwrapper.c Sat Feb 03 20:22:01 2001 +0000
+++ b/usr.sbin/mailwrapper/mailwrapper.c Sat Feb 03 20:27:35 2001 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: mailwrapper.c,v 1.3 1999/05/29 18:18:15 christos Exp $ */
+/* $NetBSD: mailwrapper.c,v 1.3.8.1 2001/02/03 20:27:35 he Exp $ */
/*
* Copyright (c) 1998
@@ -49,7 +49,6 @@
static void initarg __P((struct arglist *));
static void addarg __P((struct arglist *, const char *, int));
-static void freearg __P((struct arglist *, int));
extern const char *__progname; /* from crt0.o */
@@ -82,18 +81,6 @@
al->argv[al->argc++] = (char *)arg;
}
-static void
-freearg(al, copy)
- struct arglist *al;
- int copy;
-{
- size_t i;
- if (copy)
- for (i = 0; i < al->argc; i++)
- free(al->argv[i]);
- free(al->argv);
-}
-
int
main(argc, argv, envp)
int argc;
@@ -151,14 +138,11 @@
(void)fclose(config);
+ addarg(&al, NULL, 0);
execve(to, al.argv, envp);
- freearg(&al, 0);
- free(line);
err(1, "mailwrapper: execing %s", to);
/*NOTREACHED*/
parse_error:
- freearg(&al, 0);
- free(line);
errx(1, "mailwrapper: parse error in %s at line %lu",
_PATH_MAILERCONF, (u_long)lineno);
/*NOTREACHED*/
Home |
Main Index |
Thread Index |
Old Index