~ubuntu-branches/ubuntu/wily/libxml2/wily-proposed

« back to all changes in this revision

Viewing changes to debian/patches/0032-Fix-regressions-introduced-by-CVE-2014-0191-patch.patch

  • Committer: Package Import Robot
  • Author(s): Aron Xu
  • Date: 2014-10-26 07:04:50 UTC
  • mfrom: (43.2.7 sid)
  • Revision ID: package-import@ubuntu.com-20141026070450-rmcqvcqn8peeuebs
Tags: 2.9.2+dfsg1-1
* New upstream release (Closes: #765722, CVE-2014-3660)
* Remove no-longer-needed upstream patches
* Update distro patch
* Std-ver: 3.9.5 -> 3.9.6, no change.

Show diffs side-by-side

added added

removed removed

Lines of Context:
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
4
 
 
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
7
 
postvalidation.
8
 
https://bugzilla.gnome.org/show_bug.cgi?id=730290
9
 
and other reports on list, off-list and on Red Hat bugzilla
10
 
---
11
 
 parser.c |   13 +++++++++++--
12
 
 1 file changed, 11 insertions(+), 2 deletions(-)
13
 
 
14
 
diff --git a/parser.c b/parser.c
15
 
index 8aad7b4..ea0ea65 100644
16
 
--- a/parser.c
17
 
+++ b/parser.c
18
 
@@ -2595,8 +2595,8 @@ xmlParserHandlePEReference(xmlParserCtxtPtr ctxt) {
19
 
                    xmlCharEncoding enc;
20
 
 
21
 
                    /*
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))
37
 
                        return;
38
 
 
39
 
@@ -12609,6 +12612,9 @@ xmlIOParseDTD(xmlSAXHandlerPtr sax, xmlParserInputBufferPtr input,
40
 
        return(NULL);
41
 
     }
42
 
 
43
 
+    /* We are loading a DTD */
44
 
+    ctxt->options |= XML_PARSE_DTDLOAD;
45
 
+
46
 
     /*
47
 
      * Set-up the SAX context
48
 
      */
49
 
@@ -12736,6 +12742,9 @@ xmlSAXParseDTD(xmlSAXHandlerPtr sax, const xmlChar *ExternalID,
50
 
        return(NULL);
51
 
     }
52
 
 
53
 
+    /* We are loading a DTD */
54
 
+    ctxt->options |= XML_PARSE_DTDLOAD;
55
 
+
56
 
     /*
57
 
      * Set-up the SAX context
58
 
      */