1
0
mirror of https://gitlab.gnome.org/GNOME/libxml2.git synced 2024-10-26 20:25:14 +03:00
Commit Graph

109 Commits

Author SHA1 Message Date
Nick Wellnhofer
0f568c0b73 Consolidate private header files
Private functions were previously declared

- in header files in the root directory
- in public headers guarded with IN_LIBXML
- in libxml.h
- redundantly in source files that used them.

Consolidate all private header files in include/private.
2022-08-26 02:11:56 +02:00
Nick Wellnhofer
346c3a930c Remove elfgcchack.h
The same optimization can be enabled with -fno-semantic-interposition
since GCC 5. clang has always used this option by default.
2022-02-20 21:49:04 +01:00
Nick Wellnhofer
2c74712977 Fix error reporting with xi:fallback
When reporting errors, don't use href of xi:include if xi:fallback
was used. I think this can only be reproduced with
"xmllint --postvalid", see the original bug report:

https://bugzilla.gnome.org/show_bug.cgi?id=152623
2020-08-17 01:17:39 +02:00
Nick Wellnhofer
20c60886e4 Fix typos
Resolves #133.
2020-03-08 17:41:53 +01:00
Jared Yanovich
2a350ee9b4 Large batch of typo fixes
Closes #109.
2019-09-30 18:04:38 +02:00
Nick Wellnhofer
19f0950d30 Fix -Wcast-function-type warnings (GCC 8)
Use xmlGenericError instead of fprintf as error handler. It also prints
to stderr by default.
2019-01-06 14:25:12 +01:00
Nick Wellnhofer
8bbe4508ef Spelling and grammar fixes
Fixes bug 743172, bug 743489, bug 769632, bug 782400 and a few other
misspellings.
2017-06-17 16:34:23 +02:00
David Kilzer
4472c3a5a5 Fix some format string warnings with possible format string vulnerability
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.
2016-05-23 15:01:07 +08:00
Pavel Raiskup
c4184ba217 error.c: *input->cur == 0 does not mean no error
Complements: ce0b0d0d81
2016-04-08 10:32:29 +08:00
Daniel Veillard
ce0b0d0d81 Do not print error context when there is none
Which now happens more frequently du to xmlHaltParser use
2015-11-20 15:01:22 +08:00
Daniel Veillard
f8e3db0445 Big space and tab cleanup
Remove all space before tabs and space and tabs at end of lines.
2012-09-11 13:26:36 +08:00
Pietro Cerutti
890faa546b Fix problem with specific and generic error handlers
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.
2012-08-27 13:24:08 +08:00
Daniel Veillard
97fa5b3c8f Fix file and line report for XSD SAX and reader streaming validation
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.
2012-08-14 11:01:07 +08:00
Daniel Veillard
968a03a2e5 Add support for big line numbers in error reporting
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
2012-08-13 12:41:33 +08:00
Daniel Veillard
5756038650 Cleanup URI module memory allocation code
* 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
2012-07-24 11:44:23 +08:00
c2a0fdc4e6 __xmlRaiseError: fix use of the structured callback channel
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.
2011-02-23 22:44:05 +08:00
241d4a1069 __xmlRaiseError: fix the structured callback channel's data initialization
if we initialize the structured channel from the sax handler we should also
pass the userData
2011-02-23 22:30:59 +08:00
1b9128bae7 __xmlRaiseError: remove redundant schannel initialization
In case the domain is XML_FROM_VALID, ctxt and schannel are already initialized
earlier with the same data
2011-02-23 22:23:25 +08:00
111d705c28 __xmlRaiseError: do cheap code check early
if error code is XML_ERR_OK return immediately
2011-02-23 22:14:19 +08:00
Daniel Veillard
26b0687435 xmlCtxtResetLastError should reset ctxt->errNo
just fix it !
2010-03-15 15:59:07 +01:00
Daniel Veillard
594e5dfb48 Chasing dead assignments reported by clang-scan
* 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)
2009-09-07 14:58:47 +02:00
Wang Lam
1de382eb06 Fix SetGenericErrorFunc and SetStructured clash
* 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
2009-08-24 17:34:25 +02:00
Daniel Veillard
719f397e6f fix structured error handling problems #564217 daniel
* error.c: fix structured error handling problems #564217
daniel

svn path=/trunk/; revision=3826
2009-04-02 12:04:35 +00:00
Daniel Veillard
fa75097343 avoid a scary realloc() loop should fix #520383 Daniel
* error.c: avoid a scary realloc() loop should fix #520383
Daniel

svn path=/trunk/; revision=3725
2008-04-03 07:31:25 +00:00
Daniel Veillard
dbf7bfed8a fixing a portability problem on some old Unices with patch from Albert
* error.c: fixing a portability problem on some old Unices with
  patch from Albert Chin
Daniel
2005-10-28 08:25:51 +00:00
Daniel Veillard
d070d3ca68 Adrian Mouat pointed out redundancies in xmlReportError() Daniel
* error.c: Adrian Mouat pointed out redundancies in xmlReportError()
Daniel
2005-09-27 09:20:07 +00:00
Daniel Veillard
8ce01ce31e fixed bug #310033, the URI extraction code given a node is a bit twisted
* error.c: fixed bug #310033, the URI extraction code given a
  node is a bit twisted and broke in the last months.
Daniel
2005-08-25 20:14:38 +00:00
Daniel Veillard
1fc3ed0280 finally converted the encoding module to the common error reporting
* 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
2005-08-24 12:46:09 +00:00
Daniel Veillard
ffa3c74933 applied a patch from Marcus Boerger to fix problems with calling
* 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
2005-07-21 13:24:09 +00:00
Daniel Veillard
da0aa4cfdb applied patch from Marcus Boerger to route relaxng and schemas error
* 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
2005-07-13 23:07:49 +00:00
Daniel Veillard
39e5c89016 fixing a leak detected by testapi in xmlDOMWrapAdoptNode, and fixing
* 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
2005-07-03 22:48:50 +00:00
Daniel Veillard
dbee0f1989 working some weird error reporting problem for DTD validation. augmented
* 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
2005-06-27 13:42:57 +00:00
Daniel Veillard
5d4644ef6e revamped the elfgcchack.h format to cope with gcc4 change of aliasing
* 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
2005-04-01 13:11:58 +00:00
Aleksey Sanin
8fdc32abfe fixing col information in xmlParserInput and propagating column into xmlError 2005-01-05 15:37:55 +00:00
Daniel Veillard
ce1648b124 applied DSO support patch 2 from Joel Reed Daniel
* 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
2005-01-04 15:10:22 +00:00
Daniel Veillard
370ba3d231 fixed the leak reported by Volker Roth on the list added a specific test
* parser.c: fixed the leak reported by Volker Roth on the list
* test/ent10 result//ent10*: added a specific test for the problem
Daniel
2004-10-25 16:23:56 +00:00
William M. Brack
d0407520d8 added some coding to attempt to display which file contains an error when
* error.c: added some coding to attempt to display which file
  contains an error when using XInclude (bug 152623)
2004-10-02 03:54:00 +00:00
Daniel Veillard
da3b29a5c4 added a dumb rule to able to compile tst.c when people submit a sample
* 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
2004-08-14 11:15:13 +00:00
William M. Brack
a3215c7ae6 many further little changes for OOM problems. Now seems to be getting
* 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.
2004-07-31 16:24:01 +00:00
William M. Brack
9f797abdb9 implemented patches supplied by Olivier Andrieu (bug 148588), plus made
* 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
2004-07-28 07:40:12 +00:00
William M. Brack
cd3628b7dd fixed to assure user data param is set correctly when user structured
* error.c: fixed to assure user data param is set correctly
  when user structured error handler is called (bug 144823)
2004-07-25 21:07:29 +00:00
William M. Brack
d233e39578 modified to assure proper user data is sent to structured error routine
* error.c: modified to assure proper user data is sent to
  structured error routine (bug 142598)
2004-05-16 03:12:08 +00:00
Daniel Veillard
da0ff5da92 Johnson Cameron pointed out that initGenericErrorDefaultFunc() was really
* 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
2004-04-20 09:45:26 +00:00
Daniel Veillard
d34b0b8fb8 applied patch from Stphane Bidoul for structured error reporting. Daniel
* error.c: applied patch from Stphane Bidoul for structured error
  reporting.
Daniel
2004-01-02 20:26:01 +00:00
Daniel Veillard
b5fa02085e filter warning messages if the global setting blocks them updated the
* 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
2003-12-08 17:41:29 +00:00
Daniel Veillard
f88d8cf9f1 tried to fix the problems reported in bug #126735 fixed again some problem
* 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
2003-12-08 10:25:02 +00:00
Daniel Veillard
fded7bf91b fixed __xmlRaiseError to use structured error handlers defined by
* error.c: fixed __xmlRaiseError to use structured error handlers
  defined by xmlSetStructuredErrorFunc(), fixes bug #126211
Daniel
2003-12-07 21:30:45 +00:00
Daniel Veillard
72b9e29edf cleanup fixing bug #125653 sometimes the error handlers can get a parser
* 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
2003-10-28 15:44:17 +00:00
Daniel Veillard
3e35f8e658 preparing libxml2-2.6.0 updated and regenerated the docs and API moved the
* 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
2003-10-21 00:05:38 +00:00
Daniel Veillard
659e71ec24 Setting up the framework for structured error reporting, touches a lot of
* 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
2003-10-10 14:10:40 +00:00