]> git.ipfire.org Git - thirdparty/dovecot/core.git/commitdiff
lib-mail: Added broken input workaround to rfc822_parse_content_param().
authorTimo Sirainen <tss@iki.fi>
Thu, 22 Sep 2011 10:09:18 +0000 (13:09 +0300)
committerTimo Sirainen <tss@iki.fi>
Thu, 22 Sep 2011 10:09:18 +0000 (13:09 +0300)
src/lib-mail/rfc822-parser.c

index b3eb3782c4f1bee87f7d83b34c005615d016dd7b..b217d5e2b47f8443dff6b7fa338d95d0fe025fd9 100644 (file)
@@ -408,6 +408,15 @@ int rfc822_parse_content_param(struct rfc822_parser_context *ctx,
        } 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);
        }