summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorGilles Chehade <gilles@cvs.openbsd.org>2014-10-12 18:58:58 +0000
committerGilles Chehade <gilles@cvs.openbsd.org>2014-10-12 18:58:58 +0000
commit9822ed1561682db780d95d59972c9ff9d6af5775 (patch)
tree3fd2f0428317981757e322205bf2ee90995aa563
parent1b852a602fb36bf175fcf3c690c1917be81bbdb2 (diff)
do not allow header to termine with pending flags
-rw-r--r--usr.sbin/smtpd/rfc822.c6
1 files changed, 5 insertions, 1 deletions
diff --git a/usr.sbin/smtpd/rfc822.c b/usr.sbin/smtpd/rfc822.c
index b598fa1ff07..1e0ca34f352 100644
--- a/usr.sbin/smtpd/rfc822.c
+++ b/usr.sbin/smtpd/rfc822.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: rfc822.c,v 1.1 2014/10/12 18:54:31 gilles Exp $ */
+/* $OpenBSD: rfc822.c,v 1.2 2014/10/12 18:58:57 gilles Exp $ */
/*
* Copyright (c) 2014 Gilles Chehade <gilles@poolp.org>
@@ -83,6 +83,10 @@ parse_addresses(struct rfc822_parser *rp, const char *buffer, size_t len)
*wptr++ = *s;
}
+ /* some flags still set, malformed header */
+ if (rp->escape || rp->comment || rp->quote || rp->bracket)
+ return 0;
+
/* no value, malformed header */
if (ra->name[0] == '\0' && ra->address[0] == '\0')
return 0;