dovecot-2.0: lib-mail: Added broken input workaround to rfc822_p...

dovecot at dovecot.org dovecot at dovecot.org
Thu Sep 22 13:10:21 EEST 2011


details:   http://hg.dovecot.org/dovecot-2.0/rev/dc9028da338b
changeset: 12936:dc9028da338b
user:      Timo Sirainen <tss at iki.fi>
date:      Thu Sep 22 13:09:18 2011 +0300
description:
lib-mail: Added broken input workaround to rfc822_parse_content_param().

diffstat:

 src/lib-mail/rfc822-parser.c |  9 +++++++++
 1 files changed, 9 insertions(+), 0 deletions(-)

diffs (19 lines):

diff -r 956bfcc89dea -r dc9028da338b src/lib-mail/rfc822-parser.c
--- a/src/lib-mail/rfc822-parser.c	Thu Sep 22 01:38:34 2011 +0300
+++ b/src/lib-mail/rfc822-parser.c	Thu Sep 22 13:09:18 2011 +0300
@@ -408,6 +408,15 @@
 	} else if (*ctx->data == '"') {
 		ret = rfc822_parse_quoted_string(ctx, tmp);
 		str_unescape(str_c_modifiable(tmp) + value_pos);
+	} else if (ctx->data != ctx->end && *ctx->data == '=') {
+		/* workaround for broken input:
+		   name==?utf-8?b?...?= */
+		while (ctx->data != ctx->end && *ctx->data != ';' &&
+		       *ctx->data != ' ' && *ctx->data != '\t' &&
+		       *ctx->data != '\r' && *ctx->data != '\n') {
+			str_append_c(tmp, *ctx->data);
+			ctx->data++;
+		}
 	} else {
 		ret = rfc822_parse_mime_token(ctx, tmp);
 	}


More information about the dovecot-cvs mailing list