summaryrefslogtreecommitdiffstats
path: root/usr.sbin/cron
diff options
context:
space:
mode:
authorsilby <silby@FreeBSD.org>2003-06-19 20:04:51 +0000
committersilby <silby@FreeBSD.org>2003-06-19 20:04:51 +0000
commit565718980b04b55fae0040e6cfee7aca06855414 (patch)
treed397125617dcba60c5f74b47c517376760cef45e /usr.sbin/cron
parent022a064860ff646a47196a20a2f231e964ae385b (diff)
downloadFreeBSD-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.c3
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;
OpenPOWER on IntegriCloud