After an evaluation, GNOME has moved from Bugzilla to GitLab. Learn more about GitLab.
No new issues can be reported in GNOME Bugzilla anymore.
To report an issue in a GNOME project, go to GNOME GitLab.
Do not go to GNOME Gitlab for: Bluefish, Doxygen, GnuCash, GStreamer, java-gnome, LDTP, NetworkManager, Tomboy.
Bug 345752 - xpath.c cannot compile
xpath.c cannot compile
Status: RESOLVED FIXED
Product: libxml2
Classification: Platform
Component: general
git master
Other All
: Normal normal
: ---
Assigned To: kbuchcik
libxml QA maintainers
Depends on:
Blocks:
 
 
Reported: 2006-06-23 14:32 UTC by Kupriyanov Anatolij
Modified: 2006-06-23 16:38 UTC
See Also:
GNOME target: ---
GNOME version: ---



Description Kupriyanov Anatolij 2006-06-23 14:32:27 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:
Comment 1 kbuchcik 2006-06-23 16:37:07 UTC
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!