GNOME Bugzilla – Bug 564217
Sax structured error handler incorrectly overriden
Last modified: 2009-08-21 22:08:06 UTC
Please describe the problem: If you install a global structure error handler, it incorrectly overrides a sax specific error handler. If you follow the instructions to reproduce you'll see: xmlParseElement -> xmlFatalErrMsgStrIntStr -> xmlRaiseError xmlFatalErrMsgStrIntStr passes NULL for the channel and schannel. xmlRaiseError then correctly sets the schannel around line 461 in error.c: if ((schannel == NULL) && (ctxt != NULL) && (ctxt->sax != NULL) && (ctxt->sax->initialized == XML_SAX2_MAGIC)) schannel = ctxt->sax->serror; } But then around line 606: } else if (channel == NULL) { if (xmlStructuredError != NULL) schannel = xmlStructuredError; else This code is incorrect in my view. It should be: } else if (channel == NULL) { if (schannel == NULL && xmlStructuredError != NULL) schannel = xmlStructuredError; else Thanks, Charlie Steps to reproduce: 1. Setup a sax parser with a structured error handler 2. Install a global structured error handler 3. Parse an invalid document (for example, <Foo>) 4. The global handler is called, not the sax one Actual results: Expected results: Does this happen every time? Other information:
Okay, makes sense, but next time if you have a patch attach it to the bug and flag it as such, this help against patches lost in the large set of issues. Applied and commited, thanks, Daniel
@Daniel: you mention that you've applied and committed this patch; any estimate on when the next version (2.7.4?) of libxml2 will be released?
within a few days, probably early next week Daniel