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 724903 - valid.c erroneously ignores a validation error if no error callback set
valid.c erroneously ignores a validation error if no error callback set
Status: RESOLVED FIXED
Product: libxml2
Classification: Platform
Component: general
git master
Other Linux
: Normal normal
: ---
Assigned To: Daniel Veillard
libxml QA maintainers
Depends on:
Blocks:
 
 
Reported: 2014-02-21 17:19 UTC by Stefan Behnel
Modified: 2015-09-10 11:53 UTC
See Also:
GNOME target: ---
GNOME version: ---



Description Stefan Behnel 2014-02-21 17:19:10 UTC
valid.c contains this code:

   2636 if ((ctxt != NULL) && (ctxt->error != NULL)) {
   2637 xmlErrValidNode(ctxt, attr->parent, XML_DTD_ID_REDEFINED,
   2638 "ID %s already defined\n",
   2639 value, NULL, NULL);
   2640 }

It prevents the error from being reported if ctxt->error is not set, although simply calling xmlErrValifNode() would properly report the error to the global error callback if the NULL checks above didn't exist.
Comment 1 Daniel Veillard 2014-06-10 08:08:13 UTC
okay, indeed, fix commited in master:

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

 thanks !

Daniel
Comment 2 jb999 2015-05-21 10:31:50 UTC
This suddenly causes validity errors "ID ... already defined" even if the id is only defined once.

Please see https://mail.gnome.org/archives/xml/2014-September/msg00013.html as well.
Comment 3 jb999 2015-05-21 16:27:22 UTC
I should have mentioned that probably the follow-up (https://mail.gnome.org/archives/xml/2014-September/msg00014.html) is the more intersting one.

Creation of HTML docs (like MPlayer's doc for example) prints lots of the aboved mentioned errors now. It used to work OK before.
Comment 4 jb999 2015-05-21 16:55:11 UTC
(In reply to jb999 from comment #3)
> Creation of HTML docs (like MPlayer's doc for example) prints lots of the
> aboved mentioned errors now. It used to work OK before.
This is due to ctxt being NULL.
Comment 5 jb999 2015-05-21 18:21:36 UTC
It seems that checking if (ctxt != NULL)(In reply to jb999 from comment #4)
> This is due to ctxt being NULL.

So checking "if (ctxt != NULL)" prior to calling xmlErrValidNode() eliminates the validity errors "ID ... already defined".
Comment 6 Daniel Veillard 2015-09-10 11:53:01 UTC
Okay indeed I had to revert part of it, for

  https://bugzilla.gnome.org/show_bug.cgi?id=737840

thanks !

Daniel