]> git.ipfire.org Git - thirdparty/dovecot/core.git/commitdiff
lib-mail: Added asserts
authorTimo Sirainen <tss@iki.fi>
Tue, 7 Oct 2014 17:28:06 +0000 (20:28 +0300)
committerTimo Sirainen <tss@iki.fi>
Tue, 7 Oct 2014 17:28:06 +0000 (20:28 +0300)
src/lib-mail/message-parser.c

index 0f5a2bdbfe8799783f0888b36f59bc06519cd6d1..58c7857555c7ed2b7b29b7804dfeca16746daf96 100644 (file)
@@ -984,6 +984,8 @@ message_parser_init_from_parts(struct message_part *parts,
 {
        struct message_parser_ctx *ctx;
 
+       i_assert(parts != NULL);
+
        ctx = message_parser_init_int(input, hdr_flags, flags);
        ctx->parts = ctx->part = parts;
        ctx->parse_next_block = preparsed_parse_next_header_init;
@@ -1003,6 +1005,7 @@ int message_parser_deinit(struct message_parser_ctx **_ctx,
                message_parse_header_deinit(&ctx->hdr_parser_ctx);
        i_stream_unref(&ctx->input);
        pool_unref(&ctx->parser_pool);
+       i_assert(ret < 0 || *parts_r != NULL);
        return ret;
 }