From: Tomas Mraz Date: Fri, 18 Sep 2009 14:14:42 +0000 (+0200) Subject: Do not segfault if mailto does not pass safe_p test. X-Git-Tag: cronie1.4.2~2 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=cd701fdd9df178112e049d166405462933a3b987;p=cronie Do not segfault if mailto does not pass safe_p test. --- diff --git a/src/do_command.c b/src/do_command.c index b4917a1..05736a5 100644 --- a/src/do_command.c +++ b/src/do_command.c @@ -330,7 +330,7 @@ static void child_process(entry * e, user * u) { int ch = getc(in); if (ch != EOF) { - FILE *mail = 0L; + FILE *mail = NULL; int bytes = 1; int status = 0; @@ -453,7 +453,7 @@ static void child_process(entry * e, user * u) { while (EOF != (ch = getc(in))) { bytes++; - if (mailto) + if (mail) putc(ch, mail); } @@ -461,7 +461,7 @@ static void child_process(entry * e, user * u) { * mailing... */ - if (mailto) { + if (mail) { Debug(DPROC, ("[%ld] closing pipe to mail\n", (long) getpid())) /* Note: the pclose will probably see * the termination of the grandchild @@ -476,7 +476,7 @@ static void child_process(entry * e, user * u) { * log the facts so the poor user can figure out * what's going on. */ - if (mailto && status) { + if (mail && status) { char buf[MAX_TEMPSTR]; sprintf(buf,