LogoopenSUSE Build Service > Projects
Sign Up | Log In

View File libxml2-CVE-2010-4494.patch of Package libxml2 (Project home:lijews:zabkaoS_111)

Index: libxml2-2.7.3/xpath.c
===================================================================
--- libxml2-2.7.3.orig/xpath.c
+++ libxml2-2.7.3/xpath.c
@@ -11749,11 +11749,16 @@ xmlXPathCompOpEvalPositionalPredicate(xm
 
 	    if ((ctxt->error != XPATH_EXPRESSION_OK) || (res == -1)) {
 	        xmlXPathObjectPtr tmp;
-		/* pop the result */
+		/* pop the result if any */
 		tmp = valuePop(ctxt);
+                if (tmp != contextObj) {
+                    /*
+                     * Free up the result
+                     * then pop off contextObj, which will be freed later
+                     */
 		xmlXPathReleaseObject(xpctxt, tmp);
-		/* then pop off contextObj, which will be freed later */
 		valuePop(ctxt);
+                }
 		goto evaluation_error;
 	    }