]> git.ipfire.org Git - thirdparty/dovecot/core.git/commitdiff
message header parser: Allow NULs in header name also when header is missing ':'.
authorTimo Sirainen <tss@iki.fi>
Fri, 20 May 2011 18:46:32 +0000 (21:46 +0300)
committerTimo Sirainen <tss@iki.fi>
Fri, 20 May 2011 18:46:32 +0000 (21:46 +0300)
This doesn't fix any crashes/corruption unlike the earlier fix, but it makes
the code more correct. Although it might help with mbox rewriting seeing
some size mismatches (or might not).

src/lib-mail/message-header-parser.c

index 945c86db139db89b5535b805008518d6fa63291e..a4937f4925514a3f81692fe3105a0564b579891a 100644 (file)
@@ -268,7 +268,7 @@ int message_parse_header_next(struct message_header_parser_ctx *ctx,
                line->value_len = 0;
 
                str_truncate(ctx->name, 0);
-               str_append_n(ctx->name, msg, size);
+               buffer_append(ctx->name, msg, size);
                line->name = str_c(ctx->name);
                line->name_len = str_len(ctx->name);