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

dovecot at dovecot.org dovecot at dovecot.org
Thu Sep 22 13:09:29 EEST 2011


details:   http://hg.dovecot.org/dovecot-2.1/rev/00b6848a5a63
changeset: 13540:00b6848a5a63
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 1ff636720b9f -r 00b6848a5a63 src/lib-mail/rfc822-parser.c
--- a/src/lib-mail/rfc822-parser.c	Thu Sep 22 12:54:27 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