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 415567 - xmlXPathCmpNodes bug for attributes
xmlXPathCmpNodes bug for attributes
Status: RESOLVED FIXED
Product: libxml2
Classification: Platform
Component: general
git master
Other All
: Normal normal
: ---
Assigned To: Daniel Veillard
libxml QA maintainers
Depends on:
Blocks:
 
 
Reported: 2007-03-07 03:16 UTC by Oleg Paraschenko
Modified: 2007-03-07 08:18 UTC
See Also:
GNOME target: ---
GNOME version: ---



Description Oleg Paraschenko 2007-03-07 03:16:53 UTC
Please describe the problem:
xpath.c(2832):xmlXPathCmpNodes(xmlNodePtr node1, xmlNodePtr node2)

If node1==node2, and node1 is the first attribute of a node, the function returns -1 instead of 0.

[code]
cur = attrNode2->prev;
while (cur != NULL) {
  if (cur == attrNode1)
    return (1);
  cur = cur->prev;
}
return (-1);
[/code]

As the attribute node is the first, cur is NULL, the loop exists, and the next instruction is return -1.

Solution:

Add something like

if (node1 == node2) {
  return 0;
}

in the beginning of the procedure.


Steps to reproduce:


Actual results:


Expected results:


Does this happen every time?


Other information:
Comment 1 William M. Brack 2007-03-07 08:18:45 UTC
Fixed in SVN - thanks!