Make sure argv gets NULL terminated if cron entry has >= MAX_ARGS arguments

Obtained from:	OpenBSD popen.c v1.3
This commit is contained in:
Andrey A. Chernov 2000-07-01 22:37:02 +00:00
parent c27edf93b0
commit c38d808de1
Notes: svn2git 2020-12-20 02:59:44 +00:00
svn path=/head/; revision=62365

View File

@ -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 */