components/libxml2/patches/12.CVE-2011-2834.patch
author Tomas Kuthan <tomas.kuthan@oracle.com>
Mon, 11 Jun 2012 22:35:26 -0700
changeset 866 c6e2467e422e
parent 624 c33a34e65bdb
permissions -rw-r--r--
7155371 "ldm init-system" on s11u1 hits libcrypto.so.1.0.0`pk11_get_session SEGV in mutex_lock_impl 6980830 Memory leaked when calling ENGINE_load_private_key()

This patch taken directly from upstream:
http://git.gnome.org/browse/libxml2/commit/?id=1d4526f6f4ec8d18c40e2a09b387652a6c1aa2cd
--- libxml2-2.7.6/xpath.c	Fri Dec  9 06:34:26 2011
+++ libxml2-2.7.6/new.xpath.c	Fri Dec  9 06:43:12 2011
@@ -2485,6 +2485,7 @@
                                              sizeof(ctxt->valueTab[0]));
         if (tmp == NULL) {
             xmlGenericError(xmlGenericErrorContext, "realloc failed !\n");
+	    ctxt->error = XPATH_MEMORY_ERROR;
             return (0);
         }
         ctxt->valueMax *= 2;
@@ -9327,6 +9328,7 @@
 		if ( (ch & 0xc0) != 0xc0 ) {
 		    xmlGenericError(xmlGenericErrorContext,
 			"xmlXPathTranslateFunction: Invalid UTF8 string\n");
+		    /* not asserting an XPath error is probably better */
 		    break;
 		}
 		/* then skip over remaining bytes for this char */
@@ -9334,6 +9336,7 @@
 		    if ( (*cptr++ & 0xc0) != 0x80 ) {
 			xmlGenericError(xmlGenericErrorContext,
 			    "xmlXPathTranslateFunction: Invalid UTF8 string\n");
+			/* not asserting an XPath error is probably better */
 			break;
 		    }
 		if (ch & 0x80) /* must have had error encountered */
@@ -13384,6 +13387,7 @@
                         xmlGenericError(xmlGenericErrorContext,
             "xmlXPathCompOpEval: variable %s bound to undefined prefix %s\n",
                                     (char *) op->value4, (char *)op->value5);
+			ctxt->error = XPATH_UNDEF_PREFIX_ERROR;
                         return (total);
                     }
 		    val = xmlXPathVariableLookupNS(ctxt->context,
@@ -13438,6 +13442,7 @@
             "xmlXPathCompOpEval: function %s bound to undefined prefix %s\n",
                                     (char *)op->value4, (char *)op->value5);
 			    xmlXPathPopFrame(ctxt, frame);
+			    ctxt->error = XPATH_UNDEF_PREFIX_ERROR;
                             return (total);
                         }
                         func = xmlXPathFunctionLookupNS(ctxt->context,
@@ -14016,6 +14021,7 @@
     }
     xmlGenericError(xmlGenericErrorContext,
                     "XPath: unknown precompiled operation %d\n", op->op);
+    ctxt->error = XPATH_INVALID_OPERAND;
     return (total);
 }