From dba3d866254fedb48e1eb9f71c95509459f6b007 Mon Sep 17 00:00:00 2001 From: Stephan Bosch Date: Sat, 12 Sep 2020 00:20:51 +0200 Subject: [PATCH] lib-smtp: test-smtp-command-parser - Add tests for input ending in partial UTF-8 sequences. --- src/lib-smtp/test-smtp-command-parser.c | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) diff --git a/src/lib-smtp/test-smtp-command-parser.c b/src/lib-smtp/test-smtp-command-parser.c index 77e2964815..5309cf3c69 100644 --- a/src/lib-smtp/test-smtp-command-parser.c +++ b/src/lib-smtp/test-smtp-command-parser.c @@ -218,6 +218,22 @@ static const struct smtp_command_parse_invalid_test .command = "MAIL FROM:f\xc3\xb6\xc3\xa4@\xc3\xb6\xc3", .error_code = SMTP_COMMAND_PARSE_ERROR_BROKEN_COMMAND, }, + { + .command = "FROP \xF1", + .error_code = SMTP_COMMAND_PARSE_ERROR_BROKEN_COMMAND, + }, + { + .command = "FROP \xF1\x80", + .error_code = SMTP_COMMAND_PARSE_ERROR_BROKEN_COMMAND, + }, + { + .command = "FROP \xF1\x80\x80", + .error_code = SMTP_COMMAND_PARSE_ERROR_BROKEN_COMMAND, + }, + { + .command = "FROP \xF1\x80\x80\x80", + .error_code = SMTP_COMMAND_PARSE_ERROR_BROKEN_COMMAND, + }, }; unsigned int invalid_command_parse_test_count = -- 2.47.3