GNOME Bugzilla – Bug 345752
xpath.c cannot compile
Last modified: 2006-06-23 16:38:30 UTC
Please describe the problem: There is xmlXPathEvalExpr function: void xmlXPathEvalExpr(xmlXPathParserContextPtr ctxt) { #ifdef XPATH_STREAMING xmlXPathCompExprPtr comp; #endif ........ xmlXPathRewriteDOSExpression(ctxt->comp, &ctxt->comp->steps[comp->last]); ........ } The expression "comp->last" cannot be compiled when XPATH_STREAMING is not defined. If it is defined, it will be NULL, that can gives NPE. Steps to reproduce: 1. 2. 3. Actual results: Expected results: Does this happen every time? Other information:
My bad, I shouldn't have added the rewrite to this function. It was intended for xmlXPathCtxtCompile() originally. However, I fixed the issues you reported. The lucky side of the bug was, that the NULLed @comp was never hit, since xmlXPathCanRewriteDosExpression() took the wrong expression string, thus this code path was not executed (at least I couldn't make it execute). Fixed now in CVS, xpath.c, revision 1.317. Thanks for the report!