summaryrefslogtreecommitdiff
path: root/usr.sbin/cron/popen.c
diff options
context:
space:
mode:
authorTodd C. Miller <millert@cvs.openbsd.org>1999-08-27 10:13:19 +0000
committerTodd C. Miller <millert@cvs.openbsd.org>1999-08-27 10:13:19 +0000
commitd134cdcb0182656ccdd7952d96b6e48dd1e01be3 (patch)
tree99bf6027f072d58e06ac04156b3cdb6468deee3a /usr.sbin/cron/popen.c
parent4d198e0f54795d72d2538c61abe8c9da9891a6dd (diff)
Make sure argv gets NULL terminated if cron entry has >= MAX_ARGS arguments.
Gleaned from RedHat info.
Diffstat (limited to 'usr.sbin/cron/popen.c')
-rw-r--r--usr.sbin/cron/popen.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/usr.sbin/cron/popen.c b/usr.sbin/cron/popen.c
index 7c232d1bc11..e2ff9a6dd39 100644
--- a/usr.sbin/cron/popen.c
+++ b/usr.sbin/cron/popen.c
@@ -24,7 +24,7 @@
*/
#ifndef lint
-static char rcsid[] = "$Id: popen.c,v 1.2 1998/03/30 06:59:47 deraadt Exp $";
+static char rcsid[] = "$Id: popen.c,v 1.3 1999/08/27 10:13:18 millert Exp $";
static char sccsid[] = "@(#)popen.c 5.7 (Berkeley) 2/14/89";
#endif /* not lint */
@@ -80,6 +80,7 @@ cron_popen(program, type)
for (argc = 0, cp = program; argc < MAX_ARGS; cp = NULL)
if (!(argv[argc++] = strtok(cp, " \t\n")))
break;
+ argv[MAX_ARGS] = NULL;
#if WANT_GLOBBING
/* glob each piece */