components/libxml2/patches/08.CVE-2010-4494.patch
branchs11-update
changeset 2452 9dc4dfa4b04d
parent 2451 f54396da08ea
child 2454 82b8521a2f38
equal deleted inserted replaced
2451:f54396da08ea 2452:9dc4dfa4b04d
     1 --- libxml2-2.7.6/xpath.c.orig	Mon Jun  6 11:10:14 2011
       
     2 +++ libxml2-2.7.6/xpath.c	Mon Jun  6 11:11:04 2011
       
     3 @@ -11739,11 +11739,16 @@
       
     4  
       
     5  	    if ((ctxt->error != XPATH_EXPRESSION_OK) || (res == -1)) {
       
     6  	        xmlXPathObjectPtr tmp;
       
     7 -		/* pop the result */
       
     8 +		/* pop the result if any */
       
     9  		tmp = valuePop(ctxt);
       
    10 -		xmlXPathReleaseObject(xpctxt, tmp);
       
    11 -		/* then pop off contextObj, which will be freed later */
       
    12 -		valuePop(ctxt);
       
    13 +		if (tmp != contextObj) {
       
    14 +		   /*
       
    15 +		    * Free up the result
       
    16 +		    * then pop off contextObj, which will be freed later
       
    17 +		    */
       
    18 +		   xmlXPathReleaseObject(xpctxt, tmp);
       
    19 +		   valuePop(ctxt);
       
    20 +		}
       
    21  		goto evaluation_error;
       
    22  	    }
       
    23