summaryrefslogtreecommitdiff
path: root/error.c
Commit message (Collapse)AuthorAgeFilesLines
* Spelling and grammar fixesNick Wellnhofer2017-06-171-2/+2
| | | | | Fixes bug 743172, bug 743489, bug 769632, bug 782400 and a few other misspellings.
* Fix some format string warnings with possible format string vulnerabilityDavid Kilzer2016-05-231-1/+1
| | | | | | | | For https://bugzilla.gnome.org/show_bug.cgi?id=761029 Decorate every method in libxml2 with the appropriate LIBXML_ATTR_FORMAT(fmt,args) macro and add some cleanups following the reports.
* error.c: *input->cur == 0 does not mean no errorPavel Raiskup2016-04-081-2/+2
| | | | Complements: ce0b0d0d81fdbb5
* Do not print error context when there is noneDaniel Veillard2015-11-201-1/+3
| | | | Which now happens more frequently du to xmlHaltParser use
* Big space and tab cleanupDaniel Veillard2012-09-111-29/+29
| | | | Remove all space before tabs and space and tabs at end of lines.
* Fix problem with specific and generic error handlersPietro Cerutti2012-08-271-1/+4
| | | | | | | It seems that setting up both xmlTextReaderSetStructuredErrorHandler and xmlSetStructuredErrorFunc confuses the code around error.c:592 and following This patch works with any combinations of using xmlSetStructuredErrorFunc, xmlTextReaderSetStructuredErrorHandler, both, or none.
* Fix file and line report for XSD SAX and reader streaming validationDaniel Veillard2012-08-141-1/+4
| | | | | | | | | | | | | | | | | | | | | | | Things now work correctly at the xmllint level: thinkpad:~/XML -> xmllint --sax --noout --schema test_schema.xsd test_xml.xml test_xml.xml:72721: Schemas validity error : Element 'level1': Missing child element(s). Expected is ( level2 ). test_xml.xml fails to validate thinkpad:~/XML -> xmllint --stream --schema test_schema.xsd test_xml.xml test_xml.xml:72721: Schemas validity error : Element 'level1': Missing child element(s). Expected is ( level2 ). test_xml.xml fails to validate thinkpad:~/XML -> * error.c: fix a corner case of not reporting lines when we should * include/libxml/xmlschemas.h doc/symbols.xml: had to add new entry points to set the filename on a validation context and a locator callback used to fetch the line and file from the context * xmlschemas.c: add the new entry points xmlSchemaValidateSetFilename() and xmlSchemaValidateSetLocator(), plus make sure the error reporting routine gets the information if available. Add a locator for SAX. * xmlreader.c: add and plug a locator for readers.
* Add support for big line numbers in error reportingDaniel Veillard2012-08-131-0/+2
| | | | | | | | | | | | | | Fix the lack of line number as reported by Johan Corveleyn <jcorvel@gmail.com> * parser.c include/libxml/parser.h: add an XML_PARSE_BIG_LINES parser option not switch on by default, it's an opt-in * SAX2.c: if XML_PARSE_BIG_LINES is set store the long line numbers in the psvi field of text nodes * tree.c: expand xmlGetLineNo to extract those informations, also make sure we can't fail on recursive behaviour * error.c: in __xmlRaiseError, if a node is provided, call xmlGetLineNo() if we can't get a valid line number. * xmllint.c: switch on XML_PARSE_BIG_LINES in xmllint
* Cleanup URI module memory allocation codeDaniel Veillard2012-07-241-0/+9
| | | | | | | | | * uri.c: cleanup the code doing the allocations, set up a structured error handler to report memory errors, and set up an abitrary limit on URI saving size * error.c include/libxml/xmlerror.h: add a new FROM_URI indication for structured error reporting, also adding strings for schematron and buffer which were missing
* __xmlRaiseError: fix use of the structured callback channelDmitry V. Levin2011-02-231-13/+8
| | | | | | If the structured callback channel is initialized, do not perform unneeded initialization of the old callback channel to avoid clobbering of the structured callback channel's data.
* __xmlRaiseError: fix the structured callback channel's data initializationDmitry V. Levin2011-02-231-1/+4
| | | | | if we initialize the structured channel from the sax handler we should also pass the userData
* __xmlRaiseError: remove redundant schannel initializationDmitry V. Levin2011-02-231-8/+0
| | | | | In case the domain is XML_FROM_VALID, ctxt and schannel are already initialized earlier with the same data
* __xmlRaiseError: do cheap code check earlyDmitry V. Levin2011-02-231-2/+2
| | | | if error code is XML_ERR_OK return immediately
* xmlCtxtResetLastError should reset ctxt->errNoDaniel Veillard2010-03-151-0/+1
| | | | just fix it !
* Chasing dead assignments reported by clang-scanDaniel Veillard2009-09-071-1/+0
| | | | | | | | * SAX2.c dict.c error.c hash.c nanohttp.c parser.c python/libxml.c relaxng.c runtest.c tree.c valid.c xinclude.c xmlregexp.c xmlsave.c xmlschemas.c xpath.c xpointer.c: mostly removing unneded affectations, but this led to a few real bugs and some part not yet understood (relaxng/interleave)
* Fix SetGenericErrorFunc and SetStructured clashWang Lam2009-08-241-8/+11
| | | | | | | | * include/libxml/globals.h globals.c global.data: define a new global variable (per thread) for structured error reporting, to not conflict with generic one * error.c: when defined use the structured error report over any generic one
* fix structured error handling problems #564217 danielDaniel Veillard2009-04-021-2/+2
| | | | | | | * error.c: fix structured error handling problems #564217 daniel svn path=/trunk/; revision=3826
* avoid a scary realloc() loop should fix #520383 DanielDaniel Veillard2008-04-031-1/+1
| | | | | | | * error.c: avoid a scary realloc() loop should fix #520383 Daniel svn path=/trunk/; revision=3725
* fixing a portability problem on some old Unices with patch from AlbertDaniel Veillard2005-10-281-3/+8
| | | | | | * error.c: fixing a portability problem on some old Unices with patch from Albert Chin Daniel
* Adrian Mouat pointed out redundancies in xmlReportError() DanielDaniel Veillard2005-09-271-8/+0
| | | | | * error.c: Adrian Mouat pointed out redundancies in xmlReportError() Daniel
* fixed bug #310033, the URI extraction code given a node is a bit twistedDaniel Veillard2005-08-251-2/+11
| | | | | | * error.c: fixed bug #310033, the URI extraction code given a node is a bit twisted and broke in the last months. Daniel
* finally converted the encoding module to the common error reportingDaniel Veillard2005-08-241-0/+3
| | | | | | | * encoding.c error.c include/libxml/xmlerror.h: finally converted the encoding module to the common error reporting mechanism * doc/* doc/html/libxml-xmlerror.html: rebuilt Daniel
* applied a patch from Marcus Boerger to fix problems with callingDaniel Veillard2005-07-211-7/+7
| | | | | | | | | | | | * error.c globals.c parser.c runtest.c testHTML.c testSAX.c threads.c valid.c xmllint.c xmlreader.c xmlschemas.c xmlstring.c xmlwriter.c include/libxml/parser.h include/libxml/relaxng.h include/libxml/valid.h include/libxml/xmlIO.h include/libxml/xmlerror.h include/libxml/xmlexports.h include/libxml/xmlschemas.h: applied a patch from Marcus Boerger to fix problems with calling conventions on Windows this should fix #309757 Daniel
* applied patch from Marcus Boerger to route relaxng and schemas errorDaniel Veillard2005-07-131-0/+2
| | | | | | | | | | * error.c relaxng.c xmlreader.c xmlschemas.c include/libxml/relaxng.h include/libxml/xmlschemas.h: applied patch from Marcus Boerger to route relaxng and schemas error messages when using the reader through the structured interface if activated. * elfgcchack.h doc/* testapi.c: rebuilt since this add new APIs to test. Daniel
* fixing a leak detected by testapi in xmlDOMWrapAdoptNode, and fixingDaniel Veillard2005-07-031-1/+1
| | | | | | | | | | | | * testapi.c tree.c: fixing a leak detected by testapi in xmlDOMWrapAdoptNode, and fixing another side effect in testapi seems to pass tests fine now. * include/libxml/parser.h parser.c: xmlStopParser() is no more limited to push mode * error.c: remove a warning * runtest.c xmllint.c: avoid compilation errors if only some parts of the library are compiled in. Daniel
* working some weird error reporting problem for DTD validation. augmentedDaniel Veillard2005-06-271-1/+3
| | | | | | | | * error.c valid.c: working some weird error reporting problem for DTD validation. * runtest.c: augmented with DTD validation tests * result/VC/OneID*: slight change in validation output. Daniel
* revamped the elfgcchack.h format to cope with gcc4 change of aliasingDaniel Veillard2005-04-011-0/+2
| | | | | | | | | | | * doc/apibuild.py doc/elfgcchack.xsl: revamped the elfgcchack.h format to cope with gcc4 change of aliasing allowed scopes, had to add extra informations to doc/libxml2-api.xml to separate the header from the c module source. * *.c: updated all c library files to add a #define bottom_xxx and reimport elfgcchack.h thereafter, and a bit of cleanups. * doc//* testapi.c: regenerated when rebuilding the API Daniel
* fixing col information in xmlParserInput and propagating column into xmlErrorAleksey Sanin2005-01-051-3/+4
|
* applied DSO support patch 2 from Joel Reed DanielDaniel Veillard2005-01-041-0/+3
| | | | | | | | | | * Makefile.am config.h.in configure.in error.c libxml-2.0.pc.in testModule.c testdso.c xml2-config.in xmllint.c xmlmodule.c include/libxml/Makefile.am include/libxml/xmlerror.h include/libxml/xmlmodule.h include/libxml/xmlversion.h.in include/libxml/xmlwin32version.h.in: applied DSO support patch 2 from Joel Reed Daniel
* fixed the leak reported by Volker Roth on the list added a specific testDaniel Veillard2004-10-251-1/+1
| | | | | | * parser.c: fixed the leak reported by Volker Roth on the list * test/ent10 result//ent10*: added a specific test for the problem Daniel
* added some coding to attempt to display which file contains an error whenWilliam M. Brack2004-10-021-7/+31
| | | | | * error.c: added some coding to attempt to display which file contains an error when using XInclude (bug 152623)
* added a dumb rule to able to compile tst.c when people submit a sampleDaniel Veillard2004-08-141-0/+2
| | | | | | | | | | | | | * Makefile.am: added a dumb rule to able to compile tst.c when people submit a sample test program * xmlschemas.c: applied small patch from Eric Haszlakiewicz to document xmlSchemasSetValidErrors() limitations, #141827 * error.c: Add information in generic and structured error setter functions that this need to be done per thread #144308 * xmlsave.c: fixed bug whith missing NOTATION(s) serialization bug #144162 * doc/xmllint.xml: typo fix #144840 Daniel
* many further little changes for OOM problems. Now seems to be gettingWilliam M. Brack2004-07-311-21/+16
| | | | | | | | | * SAX2.c, encoding.c, error.c, parser.c, tree.c, uri.c, xmlIO.c, xmlreader.c, include/libxml/tree.h: many further little changes for OOM problems. Now seems to be getting closer to "ok". * testOOM.c: added code to intercept more errors, found more problems with library. Changed method of flagging / counting errors intercepted.
* implemented patches supplied by Olivier Andrieu (bug 148588), plus madeWilliam M. Brack2004-07-281-1/+1
| | | | | | | | * SAX2.c, error.c, parser.c, tree.c, xmlreader.c: implemented patches supplied by Olivier Andrieu (bug 148588), plus made some further enhancements, to correct some problems with out of memory conditions. * testOOM.c: improved with patches from Olivier Andrieu
* fixed to assure user data param is set correctly when user structuredWilliam M. Brack2004-07-251-2/+11
| | | | | * error.c: fixed to assure user data param is set correctly when user structured error handler is called (bug 144823)
* modified to assure proper user data is sent to structured error routineWilliam M. Brack2004-05-161-4/+4
| | | | | * error.c: modified to assure proper user data is sent to structured error routine (bug 142598)
* Johnson Cameron pointed out that initGenericErrorDefaultFunc() was reallyDaniel Veillard2004-04-201-1/+1
| | | | | | | | | | | * error.c: Johnson Cameron pointed out that initGenericErrorDefaultFunc() was really wrong. * xmlreader.c include/libxml/xmlreader.h: xmlTextReaderMode enum must be made public, added some missing comments on the XMLReader header. * c14n.c: Alexsey fixed C14N bug with processing namespaces from attributes Daniel
* applied patch from Stéphane Bidoul for structured error reporting. DanielDaniel Veillard2004-01-021-0/+3
| | | | | | * error.c: applied patch from Stéphane Bidoul for structured error reporting. Daniel
* filter warning messages if the global setting blocks them updated theDaniel Veillard2003-12-081-0/+2
| | | | | | | | | * error.c: filter warning messages if the global setting blocks them * xinclude.c xmlreader.c include/libxml/xinclude.h include/libxml/xmlerror.h: updated the change of namespace at the XInclude level, raise a warning if the old one is found, and some cleanup Daniel
* tried to fix the problems reported in bug #126735 fixed again some problemDaniel Veillard2003-12-081-2/+2
| | | | | | | | | | * python/libxml.py: tried to fix the problems reported in bug #126735 * xpath.c SAX2.c error.c parser.c valid.c include/libxml/xmlerror.h: fixed again some problem trying to use the structured error handlers, c.f. bug #126735 * result/VC/ElementValid: tiny change due to the fix Daniel
* fixed __xmlRaiseError to use structured error handlers defined byDaniel Veillard2003-12-071-0/+2
| | | | | | * error.c: fixed __xmlRaiseError to use structured error handlers defined by xmlSetStructuredErrorFunc(), fixes bug #126211 Daniel
* cleanup fixing bug #125653 sometimes the error handlers can get a parserDaniel Veillard2003-10-281-0/+9
| | | | | | | | | * Makefile.am: cleanup * error.c valid.c include/libxml/xmlerror.h: fixing bug #125653 sometimes the error handlers can get a parser context on DTD errors, and sometime they don't. So be very careful when trying to grab those informations. Daniel
* preparing libxml2-2.6.0 updated and regenerated the docs and API moved theDaniel Veillard2003-10-211-1/+1
| | | | | | | | * configure.in NEWS doc/libxml2.xsa: preparing libxml2-2.6.0 * doc/*: updated and regenerated the docs and API * SAX2.c error.c tree.c: moved the line number to their proper field in elements now. Daniel
* Setting up the framework for structured error reporting, touches a lot ofDaniel Veillard2003-10-101-6/+35
| | | | | | | | | | | * HTMLparser.c c14n.c catalog.c error.c globals.c parser.c parserInternals.c relaxng.c valid.c xinclude.c xmlIO.c xmlregexp.c xmlschemas.c xpath.c xpointer.c include/libxml/globals.h include/libxml/parser.h include/libxml/valid.h include/libxml/xmlerror.h: Setting up the framework for structured error reporting, touches a lot of modules, but little code now the error handling trail has been cleaned up. Daniel
* a bit of cleanup updated with the new result strings DanielDaniel Veillard2003-10-101-2/+2
| | | | | | * error.c xmlschemas.c: a bit of cleanup * result/schemas/*.err: updated with the new result strings Daniel
* cleanup fix a funny typo converted the Schemas code to the new errorDaniel Veillard2003-10-101-3/+6
| | | | | | | | | * Makefile.am: cleanup * encoding.c: fix a funny typo * error.c xmlschemas.c xmlschemastypes.c include/libxml/xmlerror.h: converted the Schemas code to the new error handling. PITA, still need to check output from regression tests. Daniel
* final error handling cleanup converted XInclude to the new error handlingDaniel Veillard2003-10-081-2/+7
| | | | | | | * xmlIO.c: final error handling cleanup * xinclude.c error.c: converted XInclude to the new error handling * include/libxml/xmlerror.h: added XInclude errors Daniel
* Oops, DanielDaniel Veillard2003-10-081-2/+2
|
* more cleanup through the I/O error path DanielDaniel Veillard2003-10-081-2/+7
| | | | | | * error.c tree.c xmlIO.c xmllint.c: more cleanup through the I/O error path Daniel
* converting the tree module too created a simpler internal error reportingDaniel Veillard2003-10-071-0/+30
| | | | | | | * tree.c: converting the tree module too * error.c include/libxml/xmlerror.h: created a simpler internal error reporting function. Daniel