]> granicus.if.org Git - cronie/commitdiff
Do not segfault if mailto does not pass safe_p test.
authorTomas Mraz <t8m@centrum.cz>
Fri, 18 Sep 2009 14:14:42 +0000 (16:14 +0200)
committerTomas Mraz <t8m@centrum.cz>
Fri, 18 Sep 2009 14:14:42 +0000 (16:14 +0200)
src/do_command.c

index b4917a17d1a24fdead4359f90793cb7021bc0788..05736a525911c417432803c821ff8658de2641f4 100644 (file)
@@ -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,