After an evaluation, GNOME has moved from Bugzilla to GitLab. Learn more about GitLab.
No new issues can be reported in GNOME Bugzilla anymore.
To report an issue in a GNOME project, go to GNOME GitLab.
Do not go to GNOME Gitlab for: Bluefish, Doxygen, GnuCash, GStreamer, java-gnome, LDTP, NetworkManager, Tomboy.
Bug 715143 - xpath.c : Fix in If condition
xpath.c : Fix in If condition
Status: RESOLVED FIXED
Product: libxml2
Classification: Platform
Component: general
git master
Other Linux
: Normal major
: ---
Assigned To: Daniel Veillard
libxml QA maintainers
Depends on:
Blocks:
 
 
Reported: 2013-11-25 08:59 UTC by Gaurav
Modified: 2013-11-28 15:03 UTC
See Also:
GNOME target: ---
GNOME version: ---


Attachments
Fixes the If condition in xpath.c (369 bytes, patch)
2013-11-25 08:59 UTC, Gaurav
none Details | Review

Description Gaurav 2013-11-25 08:59:46 UTC
Created attachment 261387 [details] [review]
Fixes the If condition in xpath.c

In file: https://git.gnome.org/browse/libxml2/tree/xpath.c

In function : xmlXPathCmpNodesExt

 switch (node2->type) {
  ----Some Code ----
case XML_PI_NODE: {
  ----Some Code ---
if ((node2 == NULL) || (node2->type != XML_ELEMENT_NODE) ||
		(0 <= (long) node1->content))
	    {
  ------------------


Here in If condition node2->content should be checked against 0, instead of node1->content.


Attached patch from libxml2-2.9.1 version.
Comment 1 Daniel Veillard 2013-11-28 15:03:39 UTC
 Indeed, good catch ! Commited as :

https://git.gnome.org/browse/libxml2/commit/?id=fcd458318916809edc4fc4cd1ce2d5ba9aed4665

 thanks !

Daniel