dovecot-2.2: lib-mail: Don't assert-crash when multipart doesn't...

dovecot at dovecot.org dovecot at dovecot.org
Mon Apr 15 17:22:15 EEST 2013


details:   http://hg.dovecot.org/dovecot-2.2/rev/b38d5ebacf25
changeset: 16288:b38d5ebacf25
user:      Timo Sirainen <tss at iki.fi>
date:      Mon Apr 15 17:22:06 2013 +0300
description:
lib-mail: Don't assert-crash when multipart doesn't actually have any parts.

diffstat:

 src/lib-mail/message-parser.c |  5 ++++-
 1 files changed, 4 insertions(+), 1 deletions(-)

diffs (15 lines):

diff -r fc9ef7d2251a -r b38d5ebacf25 src/lib-mail/message-parser.c
--- a/src/lib-mail/message-parser.c	Sun Apr 14 21:27:29 2013 +0300
+++ b/src/lib-mail/message-parser.c	Mon Apr 15 17:22:06 2013 +0300
@@ -839,7 +839,10 @@
 	}
 	i_stream_skip(ctx->input, offset - ctx->input->v_offset);
 
-	if ((ctx->part->flags & MESSAGE_PART_FLAG_MULTIPART) == 0)
+	/* multipart messages may begin with --boundary--, which makes them
+	   not have any children. */
+	if ((ctx->part->flags & MESSAGE_PART_FLAG_MULTIPART) == 0 ||
+	    ctx->part->children == NULL)
 		ctx->parse_next_block = preparsed_parse_body_more;
 	else
 		ctx->parse_next_block = preparsed_parse_prologue_more;


More information about the dovecot-cvs mailing list