From: Timo Sirainen Date: Wed, 15 Jan 2020 19:38:26 +0000 (+0200) Subject: lib-mail: test-message-snippet - Test for invalid and truncated UTF-8 X-Git-Tag: 2.3.9.3~3 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=3e22672cc0858edfd61c4d678b793728d9906a59;p=thirdparty%2Fdovecot%2Fcore.git lib-mail: test-message-snippet - Test for invalid and truncated UTF-8 --- diff --git a/src/lib-mail/test-message-snippet.c b/src/lib-mail/test-message-snippet.c index e2b79c7c8c..735acbde47 100644 --- a/src/lib-mail/test-message-snippet.c +++ b/src/lib-mail/test-message-snippet.c @@ -3,6 +3,7 @@ #include "lib.h" #include "str.h" #include "istream.h" +#include "unichar.h" #include "message-snippet.h" #include "test-common.h" @@ -80,6 +81,16 @@ static const struct { "top\nposter\n>quote1\n>quote2\n", 100, "top poster" }, + { "Content-Type: text/plain; charset=utf-8\n" + "\n" + "Invalid utf8 \x80\xff\n", + 100, + "Invalid utf8 "UNICODE_REPLACEMENT_CHAR_UTF8 }, + { "Content-Type: text/plain; charset=utf-8\n" + "\n" + "Incomplete utf8 \xC3", + 100, + "Incomplete utf8" }, { "Content-Transfer-Encoding: quoted-printable\n" "Content-Type: text/html;\n" " charset=utf-8\n"