mirror of
https://gitlab.gnome.org/GNOME/libxml2.git
synced 2025-10-24 13:33:01 +03:00
parser: Report malloc failures
Fix many places where malloc failures aren't reported. Make xmlErrMemory public. This is useful for custom external entity loaders. Introduce new API function xmlSwitchEncodingName. Change the way how we store whether the the parser is stopped. This used to be signaled by setting ctxt->instate to XML_PARSER_EOF which was misdesigned and error-prone. Set ctxt->disableSAX to 2 instead and introduce a macro PARSER_STOPPED. Also stop to remove parser inputs in xmlHaltParser. This allows to remove many checks of ctxt->instate. Introduce xmlErrParser to handle errors if a parser context is available.
This commit is contained in:
@@ -207,12 +207,6 @@ int main(int argc, char **argv) {
|
||||
#include <libxml/xpointer.h>
|
||||
#include <libxml/debugXML.h>
|
||||
|
||||
/*
|
||||
We manually define xmlErrMemory because it's normal declaration
|
||||
is "hidden" by #ifdef IN_LIBXML
|
||||
*/
|
||||
void xmlErrMemory(xmlParserCtxtPtr ctxt, const char *extra);
|
||||
|
||||
/*
|
||||
We need some "remote" addresses, but want to avoid getting into
|
||||
name resolution delays, so we use these
|
||||
|
||||
Reference in New Issue
Block a user