diff options
author | Ed Maste <emaste@FreeBSD.org> | 2022-01-28 14:57:44 +0000 |
---|---|---|
committer | Ed Maste <emaste@FreeBSD.org> | 2022-01-28 15:02:43 +0000 |
commit | 1a0dde338df8b493d74dcb2f7bbaaa6c02cab371 (patch) | |
tree | 5d25bf953777a49669684e6e086f82423730cfa2 /contrib/dma | |
parent | 4bd030b36991a317d257f01f2808a335b3a903fb (diff) | |
download | src-1a0dde338df8b493d74dcb2f7bbaaa6c02cab371.tar.gz src-1a0dde338df8b493d74dcb2f7bbaaa6c02cab371.zip |
dma: limit lines to 998 characters
Per RFC2822 the maximum transmitted line length is "998 characters...
excluding the CRLF." In a file the maximum is 999 with the \n included.
Previously mail containing a line with exactly 999 characters would
bounce.
PR: 208261
Reported by: Helge Oldach
MFC after: 1 week
Sponsored by: The FreeBSD Foundation
Diffstat (limited to 'contrib/dma')
-rw-r--r-- | contrib/dma/mail.c | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/contrib/dma/mail.c b/contrib/dma/mail.c index 48c8ee6d4dd2..9e00c22d71db 100644 --- a/contrib/dma/mail.c +++ b/contrib/dma/mail.c @@ -43,7 +43,7 @@ #include "dma.h" -#define MAX_LINE_RFC822 1000 +#define MAX_LINE_RFC822 999 /* 998 characters plus \n */ void bounce(struct qitem *it, const char *reason) @@ -378,7 +378,7 @@ readmail(struct queue *queue, int nodot, int recp_from_header) char *line = NULL; ssize_t linelen; size_t linecap = 0; - char newline[MAX_LINE_RFC822]; + char newline[MAX_LINE_RFC822 + 1]; size_t error; int had_headers = 0; int had_from = 0; |