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

index 19850274b654726da3e69db2bd8c368cfc1c6955..227ddbc888e23ca54ee26da72d8a390034312f4e 100644 (file)
@@ -6288,6 +6288,17 @@ START_TEST(test_bad_doctype_plus)
 }
 END_TEST
 
+START_TEST(test_bad_doctype_star)
+{
+    const char *text =
+        "<!DOCTYPE 1* [ <!ENTITY foo 'bar'> ]>\n"
+        "<1*>&foo;</1*>";
+
+    expect_failure(text, XML_ERROR_INVALID_TOKEN,
+                   "'+' in document name not faulted");
+}
+END_TEST
+
 /*
  * Namespaces tests.
  */
@@ -11756,6 +11767,7 @@ make_suite(void)
     tcase_add_test(tc_basic, test_bad_doctype);
     tcase_add_test(tc_basic, test_bad_doctype_utf16);
     tcase_add_test(tc_basic, test_bad_doctype_plus);
+    tcase_add_test(tc_basic, test_bad_doctype_star);
 
     suite_add_tcase(s, tc_namespace);
     tcase_add_checked_fixture(tc_namespace,