From bfbafbcef4eed0f1b09378c3c6401ae5f206ef26 Mon Sep 17 00:00:00 2001 From: Rhodri James Date: Thu, 15 Jun 2017 13:27:37 +0100 Subject: [PATCH] Test invalid character in a hex character reference --- expat/tests/runtests.c | 14 ++++++++++++++ 1 file changed, 14 insertions(+) diff --git a/expat/tests/runtests.c b/expat/tests/runtests.c index 67312fbb..65d0a82c 100644 --- a/expat/tests/runtests.c +++ b/expat/tests/runtests.c @@ -5227,6 +5227,19 @@ START_TEST(test_invalid_character_entity) } END_TEST +START_TEST(test_invalid_character_entity_2) +{ + const char *text = + "\n" + "]>\n" + "&entity;"; + + expect_failure(text, XML_ERROR_INVALID_TOKEN, + "Out of range character reference not faulted"); +} +END_TEST + /* Test that processing instructions are picked up by a default handler */ START_TEST(test_pi_handled_in_default) { @@ -11326,6 +11339,7 @@ make_suite(void) tcase_add_test(tc_basic, test_skipped_unloaded_ext_entity); tcase_add_test(tc_basic, test_param_entity_with_trailing_cr); tcase_add_test(tc_basic, test_invalid_character_entity); + tcase_add_test(tc_basic, test_invalid_character_entity_2); tcase_add_test(tc_basic, test_pi_handled_in_default); tcase_add_test(tc_basic, test_comment_handled_in_default); tcase_add_test(tc_basic, test_pi_yml); -- 2.40.0