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 793740 - xmlTextReaderNextSibling() always returns -1
xmlTextReaderNextSibling() always returns -1
Status: RESOLVED OBSOLETE
Product: libxml2
Classification: Platform
Component: general
git master
Other Mac OS
: Normal normal
: ---
Assigned To: Daniel Veillard
libxml QA maintainers
Depends on:
Blocks:
 
 
Reported: 2018-02-23 04:08 UTC by Felix Bünemann
Modified: 2021-07-05 13:24 UTC
See Also:
GNOME target: ---
GNOME version: ---


Attachments
Patch to fix xmlTextReaderNextSibling() (723 bytes, patch)
2018-02-23 04:08 UTC, Felix Bünemann
none Details | Review
Patch to support xmlReaderNextSibling without preparsed document (1.48 KB, patch)
2018-06-23 10:27 UTC, Felix Bünemann
none Details | Review

Description Felix Bünemann 2018-02-23 04:08:58 UTC
Created attachment 368814 [details] [review]
Patch to fix xmlTextReaderNextSibling()

The function xmlTextReaderNextSibling() from xmlreader.c always returns -1 because it checks if reader->doc is NULL which is always true.

If the check is inverted to reader->doc != NULL the function starts working correctly and returns 1 if there are siblings after the current reader node and 0 if there are none, which matches the function description.

I've attached the fix as a patch and also added a PR on github:

https://github.com/GNOME/libxml2/pull/13
Comment 1 Felix Bünemann 2018-06-23 10:27:47 UTC
Created attachment 372780 [details] [review]
Patch to support xmlReaderNextSibling without preparsed document

I noticed that my previous patch was broken in two cases:

* The reader was built on a preparsed document (eg. using xmlReaderWalker(doc))
* The reader was not yet on a node (before the first call to xmlReaderRead(reader))

The updated patch addresses these cases.
Comment 2 Felix Bünemann 2018-06-23 13:35:43 UTC
Re-submitted the issue and patch as a merge request on GitLab:

* https://gitlab.gnome.org/GNOME/libxml2/issues/7
* https://gitlab.gnome.org/GNOME/libxml2/merge_requests/2
Comment 3 GNOME Infrastructure Team 2021-07-05 13:24:56 UTC
GNOME is going to shut down bugzilla.gnome.org in favor of gitlab.gnome.org.
As part of that, we are mass-closing older open tickets in bugzilla.gnome.org
which have not seen updates for a longer time (resources are unfortunately
quite limited so not every ticket can get handled).

If you can still reproduce the situation described in this ticket in a recent
and supported software version, then please follow
  https://wiki.gnome.org/GettingInTouch/BugReportingGuidelines
and create a new ticket at
  https://gitlab.gnome.org/GNOME/libxml2/-/issues/

Thank you for your understanding and your help.