[xml] xmlNodeDumpOutputInternal segfault when usingt '/' as xpath expr

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 creating an input file containing '<a>1</a>' and passing the xpath expression '/'. Every other xpath expression seems to work fine including malformed expressions. I didn't find anything like this in the archive or bugzilla.

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.


libxml2-2.6.10 built from source using gcc 2.95.4
Debian 2.4.22

Here's the code:


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