diff -up dovecot-1.0.7/src/lib-mail/message-parser.c.CVE-2011-1929 dovecot-1.0.7/src/lib-mail/message-parser.c --- dovecot-1.0.7/src/lib-mail/message-parser.c.CVE-2011-1929 2007-10-28 02:09:23.000000000 +0200 +++ dovecot-1.0.7/src/lib-mail/message-parser.c 2011-08-08 13:34:24.994305372 +0200 @@ -940,7 +940,9 @@ int message_parse_header_next(struct mes line->middle_len = (size_t)(line->value - line->middle); str_truncate(ctx->name, 0); - str_append_n(ctx->name, msg, colon_pos); + /* use buffer_append() so the name won't be truncated if there + are NULs. */ + buffer_append(ctx->name, msg, colon_pos); line->name = str_c(ctx->name); line->name_len = str_len(ctx->name); }