Re: [xml] xmlNodeDumpOutputInternal segfault when usingt '/' as xpath expr
- From: Daniel Veillard <veillard redhat com>
- To: Joel McConaughy <joel displayware com>
- Cc: xml gnome org
- Subject: Re: [xml] xmlNodeDumpOutputInternal segfault when usingt '/' as xpath expr
- Date: Mon, 5 Jul 2004 11:44:39 -0400
On Mon, Jul 05, 2004 at 08:36:43AM -0700, Joel McConaughy wrote:
I get the following segfault when using '/' as an xpath expression:
Program received signal SIGSEGV, Segmentation fault.
[Switching to Thread 1024 (LWP 6946)]
0x400d5cb8 in xmlNodeDumpOutputInternal (ctxt=0xbffff640, cur=0x804d438)
at xmlsave.c:737
737 if ((cur->ns != NULL) && (cur->ns->prefix != NULL)) {
I have modified the xpath2.c sample to dump the results of an xpath
expression using xmlNodeDumpOutput. The problem can be reproduced by
xpath2.c is used to modify the target nodes to change their value.
if You do that on / you would modify the Document Root node. This won't
work.
[...]
The only change I made to the sample was to replace update_xpath_nodes()
with get_xpath_nodes(). The code is pretty simple and I can't see any
problems however pilot error is always a possibility. Help would be
greatly appreciated. Thanks.
there is no get_xpath_nodes() in xpath2.c .
Using "/" as an XPath expression is used all the time, especially in XSLT
on top of libxml2. I don't see this being an xpath error. It likely to be
an error handling the XML_DOCUMENT_NODE nore returned from the query.
Never assume that a node is of a given type before processing it. Always
test node->type first.
Daniel
--
Daniel Veillard | Red Hat Desktop team http://redhat.com/
veillard redhat com | libxml GNOME XML XSLT toolkit http://xmlsoft.org/
http://veillard.com/ | Rpmfind RPM search engine http://rpmfind.net/
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]