components/libxml2/patches/08.CVE-2010-4494.patch
author Edwin Beasant <Edwin.Beasant@oracle.com>
Tue, 15 May 2012 19:48:50 +0100
changeset 815 e17805629856
parent 284 ca417a821aee
permissions -rw-r--r--
7168611 ksh93 in s11u1_15 and later invokes pfexec with garbage which breaks RBAC in some scenarios

--- libxml2-2.7.6/xpath.c.orig	Mon Jun  6 11:10:14 2011
+++ libxml2-2.7.6/xpath.c	Mon Jun  6 11:11:04 2011
@@ -11739,11 +11739,16 @@
 
 	    if ((ctxt->error != XPATH_EXPRESSION_OK) || (res == -1)) {
 	        xmlXPathObjectPtr tmp;
-		/* pop the result */
+		/* pop the result if any */
 		tmp = valuePop(ctxt);
-		xmlXPathReleaseObject(xpctxt, tmp);
-		/* then pop off contextObj, which will be freed later */
-		valuePop(ctxt);
+		if (tmp != contextObj) {
+		   /*
+		    * Free up the result
+		    * then pop off contextObj, which will be freed later
+		    */
+		   xmlXPathReleaseObject(xpctxt, tmp);
+		   valuePop(ctxt);
+		}
 		goto evaluation_error;
 	    }