components/libxml2/patches/09.CVE-2011-1944.patch
changeset 1044 ab6b15638457
parent 1043 585b09419d1c
child 1045 2dbef0a33dc7
--- a/components/libxml2/patches/09.CVE-2011-1944.patch	Tue Nov 06 16:27:21 2012 -0800
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,124 +0,0 @@
---- libxml2-2.7.6/xpath.c	Sun Sep 11 04:17:41 2011
-+++ libxml2-2.7.6/xpath.c.new	Sun Sep 11 04:38:33 2011
-@@ -3522,13 +3522,13 @@
-     } else if (cur->nodeNr == cur->nodeMax) {
-         xmlNodePtr *temp;
- 
--        cur->nodeMax *= 2;
--	temp = (xmlNodePtr *) xmlRealloc(cur->nodeTab, cur->nodeMax *
-+	temp = (xmlNodePtr *) xmlRealloc(cur->nodeTab, cur->nodeMax * 2 *
- 				      sizeof(xmlNodePtr));
- 	if (temp == NULL) {
- 	    xmlXPathErrMemory(NULL, "growing nodeset\n");
- 	    return;
- 	}
-+	cur->nodeMax *= 2;
- 	cur->nodeTab = temp;
-     }
-     cur->nodeTab[cur->nodeNr++] = xmlXPathNodeSetDupNs(node, ns);
-@@ -3575,8 +3575,7 @@
-     } else if (cur->nodeNr == cur->nodeMax) {
-         xmlNodePtr *temp;
- 
--        cur->nodeMax *= 2;
--	temp = (xmlNodePtr *) xmlRealloc(cur->nodeTab, cur->nodeMax *
-+	temp = (xmlNodePtr *) xmlRealloc(cur->nodeTab, cur->nodeMax * 2 *
- 				      sizeof(xmlNodePtr));
- 	if (temp == NULL) {
- 	    xmlXPathErrMemory(NULL, "growing nodeset\n");
-@@ -3583,6 +3582,7 @@
- 	    return;
- 	}
- 	cur->nodeTab = temp;
-+	cur->nodeMax *= 2;
-     }
-     if (val->type == XML_NAMESPACE_DECL) {
- 	xmlNsPtr ns = (xmlNsPtr) val;
-@@ -3627,8 +3627,7 @@
-     } else if (cur->nodeNr == cur->nodeMax) {
-         xmlNodePtr *temp;
- 
--        cur->nodeMax *= 2;
--	temp = (xmlNodePtr *) xmlRealloc(cur->nodeTab, cur->nodeMax *
-+	temp = (xmlNodePtr *) xmlRealloc(cur->nodeTab, cur->nodeMax * 2 *
- 				      sizeof(xmlNodePtr));
- 	if (temp == NULL) {
- 	    xmlXPathErrMemory(NULL, "growing nodeset\n");
-@@ -3635,6 +3634,7 @@
- 	    return;
- 	}
- 	cur->nodeTab = temp;
-+	cur->nodeMax *= 2;
-     }
-     if (val->type == XML_NAMESPACE_DECL) {
- 	xmlNsPtr ns = (xmlNsPtr) val;
-@@ -3738,8 +3738,7 @@
- 	} else if (val1->nodeNr == val1->nodeMax) {
- 	    xmlNodePtr *temp;
- 
--	    val1->nodeMax *= 2;
--	    temp = (xmlNodePtr *) xmlRealloc(val1->nodeTab, val1->nodeMax *
-+	    temp = (xmlNodePtr *) xmlRealloc(val1->nodeTab, val1->nodeMax * 2 *
- 					     sizeof(xmlNodePtr));
- 	    if (temp == NULL) {
- 	        xmlXPathErrMemory(NULL, "merging nodeset\n");
-@@ -3746,6 +3745,7 @@
- 		return(NULL);
- 	    }
- 	    val1->nodeTab = temp;
-+	    val1->nodeMax *= 2;
- 	}
- 	if (n2->type == XML_NAMESPACE_DECL) {
- 	    xmlNsPtr ns = (xmlNsPtr) n2;
-@@ -3800,8 +3800,7 @@
- 	} else if (val1->nodeNr == val1->nodeMax) {
- 	    xmlNodePtr *temp;
- 
--	    val1->nodeMax *= 2;
--	    temp = (xmlNodePtr *) xmlRealloc(val1->nodeTab, val1->nodeMax *
-+	    temp = (xmlNodePtr *) xmlRealloc(val1->nodeTab, val1->nodeMax * 2 *
- 					     sizeof(xmlNodePtr));
- 	    if (temp == NULL) {
- 	        xmlXPathErrMemory(NULL, "merging nodeset\n");
-@@ -3808,6 +3807,7 @@
- 		return(NULL);
- 	    }
- 	    val1->nodeTab = temp;
-+	    val1->nodeMax *= 2;
- 	}
- 	if (val2->nodeTab[i]->type == XML_NAMESPACE_DECL) {
- 	    xmlNsPtr ns = (xmlNsPtr) val2->nodeTab[i];
-@@ -3907,14 +3907,14 @@
- 	    } else if (set1->nodeNr >= set1->nodeMax) {
- 		xmlNodePtr *temp;
- 
--		set1->nodeMax *= 2;
- 		temp = (xmlNodePtr *) xmlRealloc(
--		    set1->nodeTab, set1->nodeMax * sizeof(xmlNodePtr));
-+		    set1->nodeTab, set1->nodeMax * 2 * sizeof(xmlNodePtr));
- 		if (temp == NULL) {
- 		    xmlXPathErrMemory(NULL, "merging nodeset\n");
- 		    return(NULL);
- 		}
- 		set1->nodeTab = temp;
-+		set1->nodeMax *= 2;
- 	    }
- 	    if (n2->type == XML_NAMESPACE_DECL) {
- 		xmlNsPtr ns = (xmlNsPtr) n2;
-@@ -3991,14 +3991,14 @@
- 	    } else if (set1->nodeNr >= set1->nodeMax) {
- 		xmlNodePtr *temp;
- 
--		set1->nodeMax *= 2;
- 		temp = (xmlNodePtr *) xmlRealloc(
--		    set1->nodeTab, set1->nodeMax * sizeof(xmlNodePtr));
-+		    set1->nodeTab, set1->nodeMax * 2 * sizeof(xmlNodePtr));
- 		if (temp == NULL) {
- 		    xmlXPathErrMemory(NULL, "merging nodeset\n");
- 		    return(NULL);
- 		}
- 		set1->nodeTab = temp;
-+		set1->nodeMax *= 2;
- 	    }
- 	    set1->nodeTab[set1->nodeNr++] = n2;
- 	}