[xslt] Segfault while copying a nodeset (document)



Hi,

here's another segfault. Attached are the files used to generate it.
Just put them in a dir and launch :
$ xsltproc test.xsl test.xml

The segfault itself happens in libxml but the root problem comes from
libxslt I think. Again the problem is in the way to manage DTD
information when copying nodes ...

Should we copy DTD nodes when you launch :
<xsl:copy-of select="document('test2.xml')"/>

I think that we shouldn't. But maybe other can think of a use of such a
feature ?

I may have a trivial patch but I need to test it later before submitting
it ...

Here's the backtrace :
#0  xmlStrchr (str=0x11 <Address 0x11 out of bounds>, val=34) at
parser.c:1240
#1  0x40094867 in xmlBufferWriteQuotedString (buf=0x805b7f8,
    string=0x11 <Address 0x11 out of bounds>) at tree.c:5193
#2  0x40095272 in xmlDtdDumpOutput (buf=0x805b7d8, dtd=0x8071930,
    encoding=0x0)
    at tree.c:5715
#3  0x40095515 in xmlNodeDumpOutput (buf=0x805b7d8, doc=0x8052930,
        cur=0x8071930, level=0, format=0, encoding=0x0) at tree.c:5861
#4  0x40025f68 in xsltSaveResultTo () from /usr/lib/libxslt.so.0
#5  0x40026125 in xsltSaveResultToFile () from /usr/lib/libxslt.so.0
#6  0x80498d8 in xmlGetExternalEntityLoader () at xmlIO.c:1646
#7  0x401162db in __libc_start_main () from /lib/libc.so.6

Cheers,
-- 
Raphaël Hertzog -+- http://strasbourg.linuxfr.org/~raphael/
Le bouche à oreille du Net : http://www.beetell.com
Naviguez sans se fatiguer à chercher : http://www.deenoo.com
Formation Linux et logiciel libre : http://www.logidee.com

<!ELEMENT vide (vide2*)>
<!ELEMENT vide2 EMPTY>

<xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform" version="1.0">

<xsl:template match="vide">
  <xsl:copy-of select="document('test2.xml')"/>
</xsl:template>

</xsl:stylesheet>
<?xml version="1.0" encoding="ISO-8859-1" ?>
<!DOCTYPE vide SYSTEM "test.dtd">
<vide>
</vide>
<?xml version="1.0" encoding="ISO-8859-1" ?>
<!DOCTYPE vide SYSTEM "test.dtd">
<vide>
</vide>


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