dovecot: The header ending a message/rfc822 doesn't belong to it...

dovecot at dovecot.org dovecot at dovecot.org
Mon Feb 4 21:25:58 EET 2008


details:   http://hg.dovecot.org/dovecot/rev/2d58b1c2dfd0
changeset: 7214:2d58b1c2dfd0
user:      Timo Sirainen <tss at iki.fi>
date:      Mon Feb 04 21:25:54 2008 +0200
description:
The header ending a message/rfc822 doesn't belong to its child MIME part.
Fixes a crash with fetching bodystructure.

diffstat:

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

diffs (30 lines):

diff -r 45bfc162a43c -r 2d58b1c2dfd0 src/lib-mail/message-parser.c
--- a/src/lib-mail/message-parser.c	Mon Feb 04 19:12:46 2008 +0200
+++ b/src/lib-mail/message-parser.c	Mon Feb 04 21:25:54 2008 +0200
@@ -168,9 +168,11 @@ static void parse_next_body_multipart_in
 	ctx->last_boundary = NULL;
 }
 
-static void parse_next_body_message_rfc822_init(struct message_parser_ctx *ctx)
+static int parse_next_body_message_rfc822_init(struct message_parser_ctx *ctx,
+					       struct message_block *block_r)
 {
 	ctx->part = message_part_append(ctx->part_pool, ctx->part);
+	return parse_next_header_init(ctx, block_r);
 }
 
 static int
@@ -532,10 +534,9 @@ static int parse_next_header(struct mess
 	if (ctx->last_boundary != NULL) {
 		parse_next_body_multipart_init(ctx);
 		ctx->parse_next_block = parse_next_body_to_boundary;
-	} else if (part->flags & MESSAGE_PART_FLAG_MESSAGE_RFC822) {
-		parse_next_body_message_rfc822_init(ctx);
-		ctx->parse_next_block = parse_next_header_init;
-	} else if (ctx->boundaries != NULL)
+	} else if (part->flags & MESSAGE_PART_FLAG_MESSAGE_RFC822)
+		ctx->parse_next_block = parse_next_body_message_rfc822_init;
+	else if (ctx->boundaries != NULL)
 		ctx->parse_next_block = parse_next_body_to_boundary;
 	else
 		ctx->parse_next_block = parse_next_body_to_eof;


More information about the dovecot-cvs mailing list