
On Wed, Oct 21, 2009 at 07:51:45PM +0100, Daniel P. Berrange wrote:
On Wed, Oct 21, 2009 at 05:24:03PM +0200, Daniel Veillard wrote:
While reviewing Rich last patch I was afraid that virXPathNodeSet() could return -1 when doing an evaluation failure. It is based on xmlXPathEval() from libxml2 whose behaviour is to possibly return NULL on XPath evaluation failure independantly of the kind of failure:
http://xmlsoft.org/html/libxml-xpath.html#xmlXPathEval
I suggest to apply this patch to make sure we always return 0 unless the returned XPath type is of the wrong type (meaning the query passed didn't evaluate to a node set and code must be fixed)
ACK
Okay, pushed ! Daniel -- Daniel Veillard | libxml Gnome XML XSLT toolkit http://xmlsoft.org/ daniel@veillard.com | Rpmfind RPM search engine http://rpmfind.net/ http://veillard.com/ | virtualization library http://libvirt.org/