]> granicus.if.org Git - libexpat/commitdiff
Test two colons in the document name in a doctype is rejected
authorRhodri James <rhodri@kynesim.co.uk>
Fri, 16 Jun 2017 16:19:31 +0000 (17:19 +0100)
committerSebastian Pipping <sebastian@pipping.org>
Sat, 22 Jul 2017 20:49:20 +0000 (22:49 +0200)
expat/tests/runtests.c

index 9a17f1beb3a4af40bd2cc159b7aec5e304c6107c..8d1ceaca63148a1c6a56de7a39c4cc75f83c5fa8 100644 (file)
@@ -7039,6 +7039,17 @@ START_TEST(test_ns_invalid_doctype)
 }
 END_TEST
 
+START_TEST(test_ns_double_colon_doctype)
+{
+    const char *text =
+        "<!DOCTYPE foo:a:doc [ <!ENTITY bar 'baz' ]>\n"
+        "<foo:a:doc>&bar;</foo:a:doc>";
+
+    expect_failure(text, XML_ERROR_SYNTAX,
+                   "Double colon in document name not faulted");
+}
+END_TEST
+
 /* Control variable; the number of times duff_allocator() will successfully allocate */
 #define ALLOC_ALWAYS_SUCCEED (-1)
 #define REALLOC_ALWAYS_SUCCEED (-1)
@@ -11768,6 +11779,7 @@ make_suite(void)
     tcase_add_test(tc_namespace, test_ns_utf16_element_leafname);
     tcase_add_test(tc_namespace, test_ns_utf16_doctype);
     tcase_add_test(tc_namespace, test_ns_invalid_doctype);
+    tcase_add_test(tc_namespace, test_ns_double_colon_doctype);
 
     suite_add_tcase(s, tc_misc);
     tcase_add_checked_fixture(tc_misc, NULL, basic_teardown);