From: Rhodri James Date: Thu, 8 Jun 2017 18:56:47 +0000 (+0100) Subject: Test bad non-start of name in unknown encoding X-Git-Tag: R_2_2_3~22^2~88 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=8c4249685fed08a7a0bef761ed763f0582885ae4;p=libexpat Test bad non-start of name in unknown encoding --- diff --git a/expat/tests/runtests.c b/expat/tests/runtests.c index 6498444e..2a3b9669 100644 --- a/expat/tests/runtests.c +++ b/expat/tests/runtests.c @@ -5384,6 +5384,20 @@ START_TEST(test_unknown_encoding_bad_name) } END_TEST +/* Test bad mid-name character in unknown encoding */ +START_TEST(test_unknown_encoding_bad_name_2) +{ + const char *text = + "\n" + "Hello, world"; + + XML_SetUnknownEncodingHandler(parser, BadEncodingHandler, + (void *)PREFIX_CONVERTER); + expect_failure(text, XML_ERROR_INVALID_TOKEN, + "Bad name in unknown encoding not faulted"); +} +END_TEST + /* Be tidy */ #undef NO_CONVERTER #undef FAILING_CONVERTER @@ -10649,6 +10663,7 @@ make_suite(void) tcase_add_test(tc_basic, test_failing_encoding_conversion_fn); tcase_add_test(tc_basic, test_unknown_encoding_success); tcase_add_test(tc_basic, test_unknown_encoding_bad_name); + tcase_add_test(tc_basic, test_unknown_encoding_bad_name_2); suite_add_tcase(s, tc_namespace); tcase_add_checked_fixture(tc_namespace,