diff --git a/expat/tests/runtests.c b/expat/tests/runtests.c index ef4eb473..70691a1c 100644 --- a/expat/tests/runtests.c +++ b/expat/tests/runtests.c @@ -5635,6 +5635,89 @@ START_TEST(test_ns_reserved_attributes_2) } END_TEST +/* Test string pool handling of namespace names of 2048 characters */ +/* Exercises a particular string pool growth path */ +START_TEST(test_ns_extremely_long_prefix) +{ + const char *text = + "" + ""; + + if (_XML_Parse_SINGLE_BYTES(parser, text, strlen(text), + XML_FALSE) == XML_STATUS_ERROR) + xml_failure(parser); +} +END_TEST + + /* Control variable; the number of times duff_allocator() will successfully allocate */ #define ALLOC_ALWAYS_SUCCEED (-1) #define REALLOC_ALWAYS_SUCCEED (-1) @@ -10226,6 +10309,7 @@ make_suite(void) tcase_add_test(tc_namespace, test_ns_extend_uri_buffer); tcase_add_test(tc_namespace, test_ns_reserved_attributes); tcase_add_test(tc_namespace, test_ns_reserved_attributes_2); + tcase_add_test(tc_namespace, test_ns_extremely_long_prefix); suite_add_tcase(s, tc_misc); tcase_add_checked_fixture(tc_misc, NULL, basic_teardown);