]> granicus.if.org Git - libexpat/commitdiff
Test parameter entity marked SYSTEM but with no ID
authorRhodri James <rhodri@kynesim.co.uk>
Tue, 20 Jun 2017 13:58:42 +0000 (14:58 +0100)
committerSebastian Pipping <sebastian@pipping.org>
Sat, 22 Jul 2017 20:49:21 +0000 (22:49 +0200)
expat/tests/runtests.c

index 4d7863eaa897e75f881c71936db12af5f36f8b8c..de43f96a5e62453f083646d7dea23a1f9abbb948 100644 (file)
@@ -6767,6 +6767,18 @@ START_TEST(test_bad_entity_3)
 }
 END_TEST
 
+START_TEST(test_bad_entity_4)
+{
+    const char *text =
+        "<!DOCTYPE doc [\n"
+        "  <!ENTITY % foo SYSTEM>\n"
+        "]>\n"
+        "<doc/>";
+    expect_failure(text, XML_ERROR_SYNTAX,
+                   "Parameter ENTITY without Public ID is not rejected");
+}
+END_TEST
+
 /*
  * Namespaces tests.
  */
@@ -12257,6 +12269,7 @@ make_suite(void)
     tcase_add_test(tc_basic, test_bad_entity);
     tcase_add_test(tc_basic, test_bad_entity_2);
     tcase_add_test(tc_basic, test_bad_entity_3);
+    tcase_add_test(tc_basic, test_bad_entity_4);
 
     suite_add_tcase(s, tc_namespace);
     tcase_add_checked_fixture(tc_namespace,