diff options
author | gshapiro <gshapiro@FreeBSD.org> | 2013-04-21 17:08:44 +0000 |
---|---|---|
committer | gshapiro <gshapiro@FreeBSD.org> | 2013-04-21 17:08:44 +0000 |
commit | 891f1b61da33280fa1ba153569b360771d27e984 (patch) | |
tree | ab52d50bcac2932bf5e37126b12ef0d2886488f1 /contrib/sendmail/src/collect.c | |
parent | 84dd41acc62e69379821ee9ff4d6461233543f07 (diff) | |
parent | a03b7e14eaaeb30fff6859c589152c8787d230e3 (diff) | |
download | FreeBSD-src-891f1b61da33280fa1ba153569b360771d27e984.zip FreeBSD-src-891f1b61da33280fa1ba153569b360771d27e984.tar.gz |
Merge sendmail 8.14.7 to HEAD
MFC after: 4 days
Diffstat (limited to 'contrib/sendmail/src/collect.c')
-rw-r--r-- | contrib/sendmail/src/collect.c | 20 |
1 files changed, 19 insertions, 1 deletions
diff --git a/contrib/sendmail/src/collect.c b/contrib/sendmail/src/collect.c index c8dcb8a..1b7b5f5 100644 --- a/contrib/sendmail/src/collect.c +++ b/contrib/sendmail/src/collect.c @@ -13,7 +13,7 @@ #include <sendmail.h> -SM_RCSID("@(#)$Id: collect.c,v 8.285 2012/06/14 23:54:02 ca Exp $") +SM_RCSID("@(#)$Id: collect.c,v 8.286 2013/03/15 17:54:12 ca Exp $") static void eatfrom __P((char *volatile, ENVELOPE *)); static void collect_doheader __P((ENVELOPE *)); @@ -300,6 +300,9 @@ collect(fp, smtpmode, hdrp, e, rsetsize) unsigned char *pbp; unsigned char peekbuf[8]; char bufbuf[MAXLINE]; +#if _FFR_REJECT_NUL_BYTE + bool hasNUL; /* has at least one NUL input byte */ +#endif /* _FFR_REJECT_NUL_BYTE */ df = NULL; ignrdot = smtpmode ? false : IgnrDot; @@ -315,6 +318,9 @@ collect(fp, smtpmode, hdrp, e, rsetsize) hdrslen = 0; numhdrs = 0; HasEightBits = false; +#if _FFR_REJECT_NUL_BYTE + hasNUL = false; +#endif /* _FFR_REJECT_NUL_BYTE */ buf = bp = bufbuf; buflen = sizeof(bufbuf); pbp = peekbuf; @@ -403,6 +409,10 @@ collect(fp, smtpmode, hdrp, e, rsetsize) SM_TIME_DEFAULT, c); } +#if _FFR_REJECT_NUL_BYTE + if (c == '\0') + hasNUL = true; +#endif /* _FFR_REJECT_NUL_BYTE */ if (c == SM_IO_EOF) goto readerr; if (SevenBitInput) @@ -893,6 +903,14 @@ readerr: e->e_bodytype = "7BIT"; } +#if _FFR_REJECT_NUL_BYTE + if (hasNUL && RejectNUL) + { + e->e_status = "5.6.1"; + usrerrenh(e->e_status, "554 NUL byte not allowed"); + } +#endif /* _FFR_REJECT_NUL_BYTE */ + if (SuperSafe == SAFE_REALLY && !bitset(EF_FATALERRS, e->e_flags)) { char *dfname = queuename(e, DATAFL_LETTER); |