diff options
author | silby <silby@FreeBSD.org> | 2003-06-19 20:04:51 +0000 |
---|---|---|
committer | silby <silby@FreeBSD.org> | 2003-06-19 20:04:51 +0000 |
commit | 565718980b04b55fae0040e6cfee7aca06855414 (patch) | |
tree | d397125617dcba60c5f74b47c517376760cef45e /usr.sbin/cron | |
parent | 022a064860ff646a47196a20a2f231e964ae385b (diff) | |
download | FreeBSD-src-565718980b04b55fae0040e6cfee7aca06855414.zip FreeBSD-src-565718980b04b55fae0040e6cfee7aca06855414.tar.gz |
Fix a coredump that would occur when fdopen was unable to
return a valid fd.
PR: 49096
Submitted by: demon
MFC after: 3 days
Diffstat (limited to 'usr.sbin/cron')
-rw-r--r-- | usr.sbin/cron/cron/do_command.c | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/usr.sbin/cron/cron/do_command.c b/usr.sbin/cron/cron/do_command.c index 4b6fe33..0133fa4 100644 --- a/usr.sbin/cron/cron/do_command.c +++ b/usr.sbin/cron/cron/do_command.c @@ -369,13 +369,14 @@ child_process(e, u) /*local*/{ register FILE *in = fdopen(stdout_pipe[READ_PIPE], "r"); - register int ch = getc(in); + register int ch; if (in == NULL) { warn("fdopen failed in child"); _exit(ERROR_EXIT); } + ch = getc(in); if (ch != EOF) { register FILE *mail; register int bytes = 1; |