--- sendmail-8.10.1/sendmail/deliver.c.ORIG Thu Apr 6 06:34:02 2000 +++ sendmail-8.10.1/sendmail/deliver.c Mon May 22 16:55:56 2000 @@ -3384,7 +3384,7 @@ ostate = OS_HEAD; bp = buf; pbp = peekbuf; - while (!ferror(mci->mci_out)) + while (!ferror(mci->mci_out) && !dead) { if (pbp > peekbuf) c = *--pbp; @@ -3440,7 +3440,8 @@ (void) putc(padc, TrafficLogFile); for (xp = buf; xp < bp; xp++) - (void) putc(*xp, TrafficLogFile); + (void) putc((unsigned char) *xp, + TrafficLogFile); if (c == '\n') (void) fputs(mci->mci_mailer->m_eol, TrafficLogFile); @@ -3448,12 +3449,16 @@ if (padc != EOF) { if (putc(padc, mci->mci_out) == EOF) + { + dead = TRUE; continue; + } pos++; } for (xp = buf; xp < bp; xp++) { - if (putc(*xp, mci->mci_out) == EOF) + if (putc((unsigned char) *xp, + mci->mci_out) == EOF) { dead = TRUE; break; @@ -3544,9 +3549,14 @@ if (d == '\n' || d == EOF) { if (TrafficLogFile != NULL) - (void) putc(c, TrafficLogFile); - if (putc(c, mci->mci_out) == EOF) + (void) putc((unsigned char) c, + TrafficLogFile); + if (putc((unsigned char) c, + mci->mci_out) == EOF) + { + dead = TRUE; continue; + } pos++; continue; } @@ -3554,7 +3564,10 @@ if (putc('!', mci->mci_out) == EOF || fputs(mci->mci_mailer->m_eol, mci->mci_out) == EOF) + { + dead = TRUE; continue; + } /* record progress for DATA timeout */ DataProgress = TRUE; @@ -3582,9 +3595,14 @@ else { if (TrafficLogFile != NULL) - (void) putc(c, TrafficLogFile); - if (putc(c, mci->mci_out) == EOF) + (void) putc((unsigned char) c, + TrafficLogFile); + if (putc((unsigned char) c, + mci->mci_out) == EOF) + { + dead = TRUE; continue; + } pos++; ostate = OS_INLINE; } @@ -3601,11 +3619,13 @@ if (TrafficLogFile != NULL) { for (xp = buf; xp < bp; xp++) - (void) putc(*xp, TrafficLogFile); + (void) putc((unsigned char) *xp, + TrafficLogFile); } for (xp = buf; xp < bp; xp++) { - if (putc(*xp, mci->mci_out) == EOF) + if (putc((unsigned char) *xp, mci->mci_out) == + EOF) { dead = TRUE; break; @@ -3651,7 +3671,7 @@ (void) bfrewind(e->e_dfp); /* some mailers want extra blank line at end of message */ - if (bitnset(M_BLANKEND, mci->mci_mailer->m_flags) && + if (!dead && bitnset(M_BLANKEND, mci->mci_mailer->m_flags) && buf[0] != '\0' && buf[0] != '\n') putline("", mci); --- sendmail-8.10.1/sendmail/util.c.ORIG Mon Apr 3 15:23:16 2000 +++ sendmail-8.10.1/sendmail/util.c Mon May 22 17:18:28 2000 @@ -935,7 +935,8 @@ while (l < q) { - if (putc(*l++, mci->mci_out) == EOF) + if (putc((unsigned char) *l++, mci->mci_out) == + EOF) { dead = TRUE; break; @@ -962,7 +963,8 @@ if (TrafficLogFile != NULL) { for (l = l_base; l < q; l++) - (void) putc(*l, TrafficLogFile); + (void) putc((unsigned char)*l, + TrafficLogFile); fprintf(TrafficLogFile, "!\n%05d >>> ", (int) getpid()); } @@ -994,8 +996,8 @@ for ( ; l < p; ++l) { if (TrafficLogFile != NULL) - (void) putc(*l, TrafficLogFile); - if (putc(*l, mci->mci_out) == EOF) + (void) putc((unsigned char)*l, TrafficLogFile); + if (putc((unsigned char) *l, mci->mci_out) == EOF) { dead = TRUE; break;