Skip to content

Commit feeb1ee

Browse files
Brian C. Youngandi34
authored andcommitted
DO NOT MERGE: Add validation for eternal enities
https://bugzilla.gnome.org/show_bug.cgi?id=780691 Bug: 36556310 Change-Id: I9450743e167c3c73af5e4071f3fc85e81d061648 (cherry picked from commit bef9af3d89d241bcb518c20cba6da2a2fd9ba049)
1 parent f854f3d commit feeb1ee

File tree

1 file changed

+8
-0
lines changed

1 file changed

+8
-0
lines changed

parser.c

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7699,6 +7699,14 @@ xmlParsePEReference(xmlParserCtxtPtr ctxt)
76997699
if (xmlPushInput(ctxt, input) < 0)
77007700
return;
77017701
} else {
7702+
if ((entity->etype == XML_EXTERNAL_PARAMETER_ENTITY) &&
7703+
((ctxt->options & XML_PARSE_NOENT) == 0) &&
7704+
((ctxt->options & XML_PARSE_DTDVALID) == 0) &&
7705+
((ctxt->options & XML_PARSE_DTDLOAD) == 0) &&
7706+
((ctxt->options & XML_PARSE_DTDATTR) == 0) &&
7707+
(ctxt->replaceEntities == 0) &&
7708+
(ctxt->validate == 0))
7709+
return;
77027710
/*
77037711
* TODO !!!
77047712
* handle the extra spaces added before and after

0 commit comments

Comments
 (0)