From bcee6525d1f10e48b0d7b75edaa079b8bf74e122 Mon Sep 17 00:00:00 2001 From: Rhodri James Date: Mon, 6 Feb 2017 18:30:36 +0000 Subject: [PATCH] Check entity parsing policy can't be changed mid-parse --- expat/tests/runtests.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/expat/tests/runtests.c b/expat/tests/runtests.c index 05f204c0..62d8171e 100644 --- a/expat/tests/runtests.c +++ b/expat/tests/runtests.c @@ -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);