summaryrefslogtreecommitdiff
path: root/usr.sbin/smtpd/rfc2822.c
diff options
context:
space:
mode:
authorGilles Chehade <gilles@cvs.openbsd.org>2014-11-23 21:27:54 +0000
committerGilles Chehade <gilles@cvs.openbsd.org>2014-11-23 21:27:54 +0000
commit07db36545b3c8d6210b3da8948b19ca250c0a220 (patch)
tree52a0e69bea39b6970311f916846dbc3b2ddbaa6c /usr.sbin/smtpd/rfc2822.c
parent91963d6b707b14b715b2250e8ef897489639931f (diff)
some third-party applications generate malformed headers which we can still
parse correctly, do not reject message as malformed in this case
Diffstat (limited to 'usr.sbin/smtpd/rfc2822.c')
-rw-r--r--usr.sbin/smtpd/rfc2822.c9
1 files changed, 7 insertions, 2 deletions
diff --git a/usr.sbin/smtpd/rfc2822.c b/usr.sbin/smtpd/rfc2822.c
index 023224d46af..afc5737a7c2 100644
--- a/usr.sbin/smtpd/rfc2822.c
+++ b/usr.sbin/smtpd/rfc2822.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: rfc2822.c,v 1.2 2014/10/15 19:23:29 gilles Exp $ */
+/* $OpenBSD: rfc2822.c,v 1.3 2014/11/23 21:27:53 gilles Exp $ */
/*
* Copyright (c) 2014 Gilles Chehade <gilles@poolp.org>
@@ -82,7 +82,12 @@ parser_feed_header(struct rfc2822_parser *rp, char *line)
return 0;
memset(rp->header.name, 0, sizeof rp->header.name);
(void)memcpy(rp->header.name, line, pos - line);
- return parser_feed_header(rp, pos + 1);
+ if (isspace(*(pos + 1)))
+ return parser_feed_header(rp, pos + 1);
+ else {
+ *pos = ' ';
+ return parser_feed_header(rp, pos);
+ }
}
/* continuation */