From: Timo Sirainen Date: Sat, 30 Aug 2008 08:27:07 +0000 (+0300) Subject: message_parser_init_from_parts(): If parts were broken, we may have assert-crashed. X-Git-Tag: 1.2.alpha1~40 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=028d1852b1d12054a817656965fb2e60a99402e4;p=thirdparty%2Fdovecot%2Fcore.git message_parser_init_from_parts(): If parts were broken, we may have assert-crashed. --HG-- branch : HEAD --- diff --git a/src/lib-mail/message-parser.c b/src/lib-mail/message-parser.c index 6a84c74cc4..6d754971a2 100644 --- a/src/lib-mail/message-parser.c +++ b/src/lib-mail/message-parser.c @@ -678,8 +678,10 @@ static int preparsed_parse_next_header(struct message_parser_ctx *ctx, i_assert(ctx->skip == 0); if (ctx->input->v_offset != ctx->part->physical_pos + - ctx->part->header_size.physical_size) + ctx->part->header_size.physical_size) { ctx->broken = TRUE; + return -1; + } return 1; }