components/libxml2/patches/13.CVE-2011-3905.patch
author Ajay Kumar M <m.ajaykumar@oracle.com>
Thu, 23 Aug 2012 22:53:50 -0700
branchs11-update
changeset 2333 f5d86984feec
parent 696 b491465fd766
permissions -rw-r--r--
7185183 panel-usermgr should be added to visual-panels group package
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
696
b491465fd766 7131703 Problem with library/libxml
Kevin Crowe <Kevin.Crowe@oracle.com>
parents:
diff changeset
     1
This patch copied/pasted from this link:
b491465fd766 7131703 Problem with library/libxml
Kevin Crowe <Kevin.Crowe@oracle.com>
parents:
diff changeset
     2
http://git.gnome.org/browse/libxml2/patch/?id=77404b8b69bc122d12231807abf1a837d121b551
b491465fd766 7131703 Problem with library/libxml
Kevin Crowe <Kevin.Crowe@oracle.com>
parents:
diff changeset
     3
----------------------------------------------------------------------
b491465fd766 7131703 Problem with library/libxml
Kevin Crowe <Kevin.Crowe@oracle.com>
parents:
diff changeset
     4
From 77404b8b69bc122d12231807abf1a837d121b551 Mon Sep 17 00:00:00 2001
b491465fd766 7131703 Problem with library/libxml
Kevin Crowe <Kevin.Crowe@oracle.com>
parents:
diff changeset
     5
From: Chris Evans <[email protected]>
b491465fd766 7131703 Problem with library/libxml
Kevin Crowe <Kevin.Crowe@oracle.com>
parents:
diff changeset
     6
Date: Wed, 14 Dec 2011 08:18:25 +0000
b491465fd766 7131703 Problem with library/libxml
Kevin Crowe <Kevin.Crowe@oracle.com>
parents:
diff changeset
     7
Subject: Make sure the parser returns when getting a Stop order
b491465fd766 7131703 Problem with library/libxml
Kevin Crowe <Kevin.Crowe@oracle.com>
parents:
diff changeset
     8
b491465fd766 7131703 Problem with library/libxml
Kevin Crowe <Kevin.Crowe@oracle.com>
parents:
diff changeset
     9
patch backported from chromiun bug fixes, assuming author is Chris
b491465fd766 7131703 Problem with library/libxml
Kevin Crowe <Kevin.Crowe@oracle.com>
parents:
diff changeset
    10
---
b491465fd766 7131703 Problem with library/libxml
Kevin Crowe <Kevin.Crowe@oracle.com>
parents:
diff changeset
    11
diff --git a/parser.c b/parser.c
b491465fd766 7131703 Problem with library/libxml
Kevin Crowe <Kevin.Crowe@oracle.com>
parents:
diff changeset
    12
index 21d7aa3..4e5dcb9 100644
b491465fd766 7131703 Problem with library/libxml
Kevin Crowe <Kevin.Crowe@oracle.com>
parents:
diff changeset
    13
--- a/parser.c
b491465fd766 7131703 Problem with library/libxml
Kevin Crowe <Kevin.Crowe@oracle.com>
parents:
diff changeset
    14
+++ b/parser.c
b491465fd766 7131703 Problem with library/libxml
Kevin Crowe <Kevin.Crowe@oracle.com>
parents:
diff changeset
    15
@@ -4949,7 +4949,8 @@ xmlParsePI(xmlParserCtxtPtr ctxt) {
b491465fd766 7131703 Problem with library/libxml
Kevin Crowe <Kevin.Crowe@oracle.com>
parents:
diff changeset
    16
 		    (ctxt->sax->processingInstruction != NULL))
b491465fd766 7131703 Problem with library/libxml
Kevin Crowe <Kevin.Crowe@oracle.com>
parents:
diff changeset
    17
 		    ctxt->sax->processingInstruction(ctxt->userData,
b491465fd766 7131703 Problem with library/libxml
Kevin Crowe <Kevin.Crowe@oracle.com>
parents:
diff changeset
    18
 		                                     target, NULL);
b491465fd766 7131703 Problem with library/libxml
Kevin Crowe <Kevin.Crowe@oracle.com>
parents:
diff changeset
    19
-		ctxt->instate = state;
b491465fd766 7131703 Problem with library/libxml
Kevin Crowe <Kevin.Crowe@oracle.com>
parents:
diff changeset
    20
+		if (ctxt->instate != XML_PARSER_EOF)
b491465fd766 7131703 Problem with library/libxml
Kevin Crowe <Kevin.Crowe@oracle.com>
parents:
diff changeset
    21
+		    ctxt->instate = state;
b491465fd766 7131703 Problem with library/libxml
Kevin Crowe <Kevin.Crowe@oracle.com>
parents:
diff changeset
    22
 		return;
b491465fd766 7131703 Problem with library/libxml
Kevin Crowe <Kevin.Crowe@oracle.com>
parents:
diff changeset
    23
 	    }
b491465fd766 7131703 Problem with library/libxml
Kevin Crowe <Kevin.Crowe@oracle.com>
parents:
diff changeset
    24
 	    buf = (xmlChar *) xmlMallocAtomic(size * sizeof(xmlChar));
b491465fd766 7131703 Problem with library/libxml
Kevin Crowe <Kevin.Crowe@oracle.com>
parents:
diff changeset
    25
@@ -5029,7 +5030,8 @@ xmlParsePI(xmlParserCtxtPtr ctxt) {
b491465fd766 7131703 Problem with library/libxml
Kevin Crowe <Kevin.Crowe@oracle.com>
parents:
diff changeset
    26
 	} else {
b491465fd766 7131703 Problem with library/libxml
Kevin Crowe <Kevin.Crowe@oracle.com>
parents:
diff changeset
    27
 	    xmlFatalErr(ctxt, XML_ERR_PI_NOT_STARTED, NULL);
b491465fd766 7131703 Problem with library/libxml
Kevin Crowe <Kevin.Crowe@oracle.com>
parents:
diff changeset
    28
 	}
b491465fd766 7131703 Problem with library/libxml
Kevin Crowe <Kevin.Crowe@oracle.com>
parents:
diff changeset
    29
-	ctxt->instate = state;
b491465fd766 7131703 Problem with library/libxml
Kevin Crowe <Kevin.Crowe@oracle.com>
parents:
diff changeset
    30
+	if (ctxt->instate != XML_PARSER_EOF)
b491465fd766 7131703 Problem with library/libxml
Kevin Crowe <Kevin.Crowe@oracle.com>
parents:
diff changeset
    31
+	    ctxt->instate = state;
b491465fd766 7131703 Problem with library/libxml
Kevin Crowe <Kevin.Crowe@oracle.com>
parents:
diff changeset
    32
     }
b491465fd766 7131703 Problem with library/libxml
Kevin Crowe <Kevin.Crowe@oracle.com>
parents:
diff changeset
    33
 }
b491465fd766 7131703 Problem with library/libxml
Kevin Crowe <Kevin.Crowe@oracle.com>
parents:
diff changeset
    34
 
b491465fd766 7131703 Problem with library/libxml
Kevin Crowe <Kevin.Crowe@oracle.com>
parents:
diff changeset
    35
@@ -9589,6 +9591,8 @@ xmlParseElement(xmlParserCtxtPtr ctxt) {
b491465fd766 7131703 Problem with library/libxml
Kevin Crowe <Kevin.Crowe@oracle.com>
parents:
diff changeset
    36
     else
b491465fd766 7131703 Problem with library/libxml
Kevin Crowe <Kevin.Crowe@oracle.com>
parents:
diff changeset
    37
 	name = xmlParseStartTag(ctxt);
b491465fd766 7131703 Problem with library/libxml
Kevin Crowe <Kevin.Crowe@oracle.com>
parents:
diff changeset
    38
 #endif /* LIBXML_SAX1_ENABLED */
b491465fd766 7131703 Problem with library/libxml
Kevin Crowe <Kevin.Crowe@oracle.com>
parents:
diff changeset
    39
+    if (ctxt->instate == XML_PARSER_EOF)
b491465fd766 7131703 Problem with library/libxml
Kevin Crowe <Kevin.Crowe@oracle.com>
parents:
diff changeset
    40
+	return;
b491465fd766 7131703 Problem with library/libxml
Kevin Crowe <Kevin.Crowe@oracle.com>
parents:
diff changeset
    41
     if (name == NULL) {
b491465fd766 7131703 Problem with library/libxml
Kevin Crowe <Kevin.Crowe@oracle.com>
parents:
diff changeset
    42
 	spacePop(ctxt);
b491465fd766 7131703 Problem with library/libxml
Kevin Crowe <Kevin.Crowe@oracle.com>
parents:
diff changeset
    43
         return;
b491465fd766 7131703 Problem with library/libxml
Kevin Crowe <Kevin.Crowe@oracle.com>
parents:
diff changeset
    44
@@ -10975,6 +10979,8 @@ xmlParseTryOrFinish(xmlParserCtxtPtr ctxt, int terminate) {
b491465fd766 7131703 Problem with library/libxml
Kevin Crowe <Kevin.Crowe@oracle.com>
parents:
diff changeset
    45
 		else
b491465fd766 7131703 Problem with library/libxml
Kevin Crowe <Kevin.Crowe@oracle.com>
parents:
diff changeset
    46
 		    name = xmlParseStartTag(ctxt);
b491465fd766 7131703 Problem with library/libxml
Kevin Crowe <Kevin.Crowe@oracle.com>
parents:
diff changeset
    47
 #endif /* LIBXML_SAX1_ENABLED */
b491465fd766 7131703 Problem with library/libxml
Kevin Crowe <Kevin.Crowe@oracle.com>
parents:
diff changeset
    48
+		if (ctxt->instate == XML_PARSER_EOF)
b491465fd766 7131703 Problem with library/libxml
Kevin Crowe <Kevin.Crowe@oracle.com>
parents:
diff changeset
    49
+		    goto done;
b491465fd766 7131703 Problem with library/libxml
Kevin Crowe <Kevin.Crowe@oracle.com>
parents:
diff changeset
    50
 		if (name == NULL) {
b491465fd766 7131703 Problem with library/libxml
Kevin Crowe <Kevin.Crowe@oracle.com>
parents:
diff changeset
    51
 		    spacePop(ctxt);
b491465fd766 7131703 Problem with library/libxml
Kevin Crowe <Kevin.Crowe@oracle.com>
parents:
diff changeset
    52
 		    ctxt->instate = XML_PARSER_EOF;
b491465fd766 7131703 Problem with library/libxml
Kevin Crowe <Kevin.Crowe@oracle.com>
parents:
diff changeset
    53
@@ -11161,7 +11167,9 @@ xmlParseTryOrFinish(xmlParserCtxtPtr ctxt, int terminate) {
b491465fd766 7131703 Problem with library/libxml
Kevin Crowe <Kevin.Crowe@oracle.com>
parents:
diff changeset
    54
 		  else
b491465fd766 7131703 Problem with library/libxml
Kevin Crowe <Kevin.Crowe@oracle.com>
parents:
diff changeset
    55
 		    xmlParseEndTag1(ctxt, 0);
b491465fd766 7131703 Problem with library/libxml
Kevin Crowe <Kevin.Crowe@oracle.com>
parents:
diff changeset
    56
 #endif /* LIBXML_SAX1_ENABLED */
b491465fd766 7131703 Problem with library/libxml
Kevin Crowe <Kevin.Crowe@oracle.com>
parents:
diff changeset
    57
-		if (ctxt->nameNr == 0) {
b491465fd766 7131703 Problem with library/libxml
Kevin Crowe <Kevin.Crowe@oracle.com>
parents:
diff changeset
    58
+		if (ctxt->instate == XML_PARSER_EOF) {
b491465fd766 7131703 Problem with library/libxml
Kevin Crowe <Kevin.Crowe@oracle.com>
parents:
diff changeset
    59
+		    /* Nothing */
b491465fd766 7131703 Problem with library/libxml
Kevin Crowe <Kevin.Crowe@oracle.com>
parents:
diff changeset
    60
+		} else if (ctxt->nameNr == 0) {
b491465fd766 7131703 Problem with library/libxml
Kevin Crowe <Kevin.Crowe@oracle.com>
parents:
diff changeset
    61
 		    ctxt->instate = XML_PARSER_EPILOG;
b491465fd766 7131703 Problem with library/libxml
Kevin Crowe <Kevin.Crowe@oracle.com>
parents:
diff changeset
    62
 		} else {
b491465fd766 7131703 Problem with library/libxml
Kevin Crowe <Kevin.Crowe@oracle.com>
parents:
diff changeset
    63
 		    ctxt->instate = XML_PARSER_CONTENT;
b491465fd766 7131703 Problem with library/libxml
Kevin Crowe <Kevin.Crowe@oracle.com>
parents:
diff changeset
    64
--
b491465fd766 7131703 Problem with library/libxml
Kevin Crowe <Kevin.Crowe@oracle.com>
parents:
diff changeset
    65
cgit v0.9.0.2
b491465fd766 7131703 Problem with library/libxml
Kevin Crowe <Kevin.Crowe@oracle.com>
parents:
diff changeset
    66