[xml] [BUG+FIX] valid.c erroneously ignores a validation error if no error callback set



Hi,

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.

The fix is to remove the surrounding "if" test.

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

Stefan


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]