Re: Strange results of xpath element search using string-value

Nick Wellnhofer <[email protected]>
Newsgroups gmane.comp.gnome.lib.xml.general
Message-ID <[email protected]>
On 02/10/2017 19:58, Daniel Veillard wrote:
>     hum ... XPath computes the string value correctly. there is something
> going on there.

The bug is in xmlXPathNodeValHash. `string` must be reset to NULL in the 
default case of this switch statement:

     https://git.gnome.org/browse/libxml2/tree/xpath.c#n6412

The bug can only be triggered if there are multiple descendant text nodes and 
the first one only contains a single character. The handling of comment and PI 
nodes in the switch statement also looks fishy.

I'll commit a fix after the 2.9.6 release.

Nick
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.