[xslt] segv



L.S.

I'm getting a segmentation-fault in xsltForEach() with the following input:
-xsl-
<xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform";>

<xsl:template match="/">
	<xsl:for-each select="//foo/bar"/>
</xsl:template>

</xsl:stylesheet>
-xsl-

and

-xml-
<?xml version="1.0" encoding="iso-8859-1"?>
<xxx/>
-xml-

I traced it down to libxslt/transform.c:xsltForEach(), around line 2421
(I didn't bother to make a diff):
	if (res->type == XPATH_NODESET)
		list = res->nodesetval;

res->nodesetval can be a NULL-pointer, so list can be invalid. I changed it
to:
	if (res->type == XPATH_NODESET && res->nodesetval)
		list = res->nodesetval;

                                                                         robert




[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]