1
From: Daniel Veillard <veillard@redhat.com>
2
Date: Wed, 11 Jun 2014 16:54:32 +0800
3
Subject: Fix regressions introduced by CVE-2014-0191 patch
5
A number of issues have been raised after the fix, and this patch
6
tries to correct all of them, though most were related to
8
https://bugzilla.gnome.org/show_bug.cgi?id=730290
9
and other reports on list, off-list and on Red Hat bugzilla
11
parser.c | 13 +++++++++++--
12
1 file changed, 11 insertions(+), 2 deletions(-)
14
diff --git a/parser.c b/parser.c
15
index 8aad7b4..ea0ea65 100644
18
@@ -2595,8 +2595,8 @@ xmlParserHandlePEReference(xmlParserCtxtPtr ctxt) {
22
- * Note: external parsed entities will not be loaded, it is
23
- * not required for a non-validating parser, unless the
24
+ * Note: external parameter entities will not be loaded, it
25
+ * is not required for a non-validating parser, unless the
26
* option of validating, or substituting entities were
27
* given. Doing so is far more secure as the parser will
28
* only process data coming from the document entity by
29
@@ -2605,6 +2605,9 @@ xmlParserHandlePEReference(xmlParserCtxtPtr ctxt) {
30
if ((entity->etype == XML_EXTERNAL_PARAMETER_ENTITY) &&
31
((ctxt->options & XML_PARSE_NOENT) == 0) &&
32
((ctxt->options & XML_PARSE_DTDVALID) == 0) &&
33
+ ((ctxt->options & XML_PARSE_DTDLOAD) == 0) &&
34
+ ((ctxt->options & XML_PARSE_DTDATTR) == 0) &&
35
+ (ctxt->replaceEntities == 0) &&
36
(ctxt->validate == 0))
39
@@ -12609,6 +12612,9 @@ xmlIOParseDTD(xmlSAXHandlerPtr sax, xmlParserInputBufferPtr input,
43
+ /* We are loading a DTD */
44
+ ctxt->options |= XML_PARSE_DTDLOAD;
47
* Set-up the SAX context
49
@@ -12736,6 +12742,9 @@ xmlSAXParseDTD(xmlSAXHandlerPtr sax, const xmlChar *ExternalID,
53
+ /* We are loading a DTD */
54
+ ctxt->options |= XML_PARSE_DTDLOAD;
57
* Set-up the SAX context