dovecot: domain-literal parsing should have skipped LWSP after it.

dovecot at dovecot.org dovecot at dovecot.org
Fri Jul 20 10:43:56 EEST 2007


details:   http://hg.dovecot.org/dovecot/rev/6bc2995619f3
changeset: 6116:6bc2995619f3
user:      Timo Sirainen <tss at iki.fi>
date:      Fri Jul 20 08:28:26 2007 +0300
description:
domain-literal parsing should have skipped LWSP after it.

diffstat:

1 file changed, 6 insertions(+), 11 deletions(-)
src/lib-mail/rfc822-parser.c |   17 ++++++-----------

diffs (31 lines):

diff -r 35d12c0cd7a7 -r 6bc2995619f3 src/lib-mail/rfc822-parser.c
--- a/src/lib-mail/rfc822-parser.c	Fri Jul 20 08:31:06 2007 +0300
+++ b/src/lib-mail/rfc822-parser.c	Fri Jul 20 08:28:26 2007 +0300
@@ -308,7 +308,7 @@ rfc822_parse_domain_literal(struct rfc82
 		} else if (*ctx->data == ']') {
 			ctx->data++;
 			str_append_n(str, start, ctx->data - start);
-			return ctx->data != ctx->end;
+			return rfc822_skip_lwsp(ctx);
 		}
 	}
 
@@ -329,13 +329,8 @@ int rfc822_parse_domain(struct rfc822_pa
 	if (rfc822_skip_lwsp(ctx) <= 0)
 		return -1;
 
-	if (*ctx->data == '[') {
-		if (rfc822_parse_domain_literal(ctx, str) < 0)
-			return -1;
-	} else {
-		if (rfc822_parse_dot_atom(ctx, str) < 0)
-			return -1;
-	}
-
-	return ctx->data != ctx->end;
-}
+	if (*ctx->data == '[')
+		return rfc822_parse_domain_literal(ctx, str);
+	else
+		return rfc822_parse_dot_atom(ctx, str);
+}


More information about the dovecot-cvs mailing list