]> granicus.if.org Git - libexpat/commitdiff
Check entity parsing policy can't be changed mid-parse
authorRhodri James <rhodri@kynesim.co.uk>
Mon, 6 Feb 2017 18:30:36 +0000 (18:30 +0000)
committerSebastian Pipping <sebastian@pipping.org>
Sun, 5 Mar 2017 21:27:13 +0000 (22:27 +0100)
expat/tests/runtests.c

index 05f204c038b48fc455aa21c801a0d07262784914..62d8171eff601e2ae3d42dc61a71037af8e67ee4 100644 (file)
@@ -1848,6 +1848,9 @@ START_TEST(test_user_parameters)
         xml_failure(parser);
     if (comment_count != 2)
         fail("Comment handler not invoked enough times");
+    /* Ensure we can't change policy mid-parse */
+    if (XML_SetParamEntityParsing(parser, XML_PARAM_ENTITY_PARSING_NEVER))
+        fail("Changed param entity parsing policy while parsing");
     if (_XML_Parse_SINGLE_BYTES(parser, epilog, strlen(epilog),
                                 XML_TRUE) == XML_STATUS_ERROR)
         xml_failure(parser);