From 6ec40ff5221c962165f6be63793555ac8cb9416b Mon Sep 17 00:00:00 2001 From: Rhodri James Date: Wed, 14 Jun 2017 19:20:29 +0100 Subject: [PATCH] Test single stray ] doesn't close a CDATA section Also uses multi-byte characters around the ] to exercise more code. --- expat/tests/runtests.c | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/expat/tests/runtests.c b/expat/tests/runtests.c index 5a5a171d..66f43e40 100644 --- a/expat/tests/runtests.c +++ b/expat/tests/runtests.c @@ -5996,6 +5996,16 @@ START_TEST(test_utf8_in_cdata_section) } END_TEST +/* Test that little-endian UTF-16 in a CDATA section is handled */ +START_TEST(test_utf8_in_cdata_section_2) +{ + const char *text = ""; + const XML_Char *expected = "\xc3\xa9]\xc3\xa9two"; + + run_character_check(text, expected); +} +END_TEST + /* * Namespaces tests. */ @@ -11317,6 +11327,7 @@ make_suite(void) tcase_add_test(tc_basic, test_ext_entity_utf16_unknown); tcase_add_test(tc_basic, test_ext_entity_utf8_non_bom); tcase_add_test(tc_basic, test_utf8_in_cdata_section); + tcase_add_test(tc_basic, test_utf8_in_cdata_section_2); suite_add_tcase(s, tc_namespace); tcase_add_checked_fixture(tc_namespace,