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

152 Commits

Author SHA1 Message Date
Andy Lutomirski
9d9685ad88 xmlTextReader bails too quickly on error
For https://bugzilla.gnome.org/show_bug.cgi?id=654567
I use xmlTextReader to parse failed that might be incomplete.  These files are
the beginning of a well-formed file, but the end is missing so the file as a
whole is not well-formed.

The problem is that xmlTextReader starts returning errors when it encounters
the early EOF, even though I haven't finished reading all of the valid data in
the file.  It would be helpful if xmlTextReader kept working until the very
end.
2012-05-15 20:10:25 +08:00
Daniel Veillard
2c437da7f0 Fix a wrong return value in previous patch 2012-05-11 12:08:15 +08:00
Lin Yi-Li
24464be639 Avoid memory leak if xmlParserInputBufferCreateIO fails
For https://bugzilla.gnome.org/show_bug.cgi?id=643949

In case of error on an IO creation input the given context
is terminated with the given close function, except if the
error happened in xmlParserInputBufferCreateIO. This can
lead to a resource leak which is fixed by this patch.
2012-05-10 16:14:55 +08:00
Noam Postavsky
1579499025 add function xmlTextReaderRelaxNGValidateCtxt()
Since there is xmlTextReaderSchemaValidateCtxt() it seems like there
should be an equivalent RelaxNG function. The attached patch adds it.
The code is essentially the same as Schema implementation, but I'm
uncertain as to how to add things to the documentation and test suite:
there seems to be a lot of auto-generation going on.
2012-03-22 10:32:11 +08:00
Rob Richards
5b9dde3eed xmlTextReaderReadOuterXml should handle DTD
* xmlreader.c: fix description of xmlTextReaderReadOuterXml and support DTD
2010-05-05 07:59:44 -04:00
Daniel Veillard
76d364583e Fixing assorted potential problems raised by scan
* encoding.c parser.c relaxng.c runsuite.c tree.c xmlreader.c
  xmlschemas.c: nothing really serious but better safe than sorry
2009-09-07 11:19:33 +02:00
Daniel Veillard
f4653dcd8b 447899 potential double free in xmlFreeTextReader
* xmlreader.c: a document may still be referenced by fakenode,
  just free fakenode before freeing the document.
2009-08-21 18:40:50 +02:00
Daniel Veillard
aacc2a2466 560524 – xmlTextReaderLocalName description
* xmlreader.c: document all functions returning xmlChar * that they
  need to free the result, and some space/tabs cleanups
2009-08-11 18:31:42 +02:00
Daniel Veillard
7e65fad1e3 patch from Riccardo Scussat fixing custom error handlers problems. daniel
* xmlreader.c: patch from Riccardo Scussat fixing custom error
  handlers problems.
daniel

svn path=/trunk/; revision=3795
2008-09-25 14:55:21 +00:00
Daniel Veillard
bfa5cf1ce7 add an --with-coverage configure option and a 'make cov' target based on
* configure.in Makefile.am: add an --with-coverage configure option
  and a 'make cov' target based on gcc profiling and the lcov
  tool. Currently at 68.9% coverage out of 'make check' and 
  runsuite executions.
* xmlreader.c: remove warnings due to C++ comments
Daniel

svn path=/trunk/; revision=3780
2008-08-27 15:33:28 +00:00
Daniel Veillard
aa6de47ebf applied patch from Aswin to fix tree skipping fixed a comment and added a
* xmlreader.c: applied patch from Aswin to fix tree skipping
* include/libxml/entities.h entities.c: fixed a comment and
  added a new xmlNewEntity() entry point
* runtest.c: be less verbose
* tree.c: space and tabs cleanups
daniel

svn path=/trunk/; revision=3774
2008-08-25 14:53:31 +00:00
Daniel Veillard
354cf5c7e4 fix a link to XmlNodeType doc reported by Martijn Arts rebuilt Daniel
* xmlreader.c: fix a link to XmlNodeType doc reported by Martijn Arts
* docs/*: rebuilt
Daniel

svn path=/trunk/; revision=3732
2008-04-07 12:46:48 +00:00
Daniel Veillard
14dad705d5 patch from Ashwin removing duplicate tests Daniel
* xmlreader.c: patch from Ashwin removing duplicate tests
Daniel

svn path=/trunk/; revision=3708
2008-03-14 14:29:40 +00:00
William M. Brack
0c1e301175 corrected small error in last commit corrected small typo in last commit
* configure.in: corrected small error in last commit
* xmlreader.c: corrected small typo in last commit

svn path=/trunk/; revision=3591
2007-03-14 12:40:21 +00:00
Daniel Veillard
a9c5677c22 applied patch from Julien Reichel cleaning up mode and state internal
* xmlreader.c: applied patch from Julien Reichel cleaning up mode
  and state internal flags mixups
Daniel

svn path=/trunk/; revision=3588
2007-03-09 16:59:05 +00:00
William M. Brack
bf9a73d2bb fixed mistake in previous commit (ChangeLog is correct)
svn path=/trunk/; revision=3581
2007-02-09 00:07:07 +00:00
William M. Brack
d46c1ca3fc added a GROW when parsing complex comments (bug #405666) added a hack to
* parser.c: added a GROW when parsing complex comments (bug #405666)
* gentest.py, testapi.c: added a hack to prevent destruction of any
  param with 'destroy' in it's description (i.e. param destroyed by
  the routine under test, so shouldn't be destroyed by testapi)
* xmlreader.c: added freeing of 'input' param even on error

svn path=/trunk/; revision=3579
2007-02-08 23:34:34 +00:00
Daniel Veillard
e96b47fd3d fix xmlTextReaderSetup() description tests which were apparently never
* xmlreader.c: fix xmlTextReaderSetup() description
* test/relaxng/empty1.rng test/relaxng/comps_0.xml
  test/relaxng/empty1_0.xml test/relaxng/comps.rng
  test/relaxng/empty0.rng test/relaxng/empty0_0.xml
  test/relaxng/empty1_1.xml: tests which were apparently 
  never commited to CVS
Daniel

svn path=/trunk/; revision=3572
2007-01-04 17:28:35 +00:00
Aleksey Sanin
d837764002 expose xmlTextReaderSetup function
svn path=/trunk/; revision=3571
2007-01-03 23:13:12 +00:00
Daniel Veillard
11ce4004d8 end of first pass on coverity reports. Daniel
* runtest.c schematron.c testAutomata.c tree.c valid.c xinclude.c
  xmlcatalog.c xmlreader.c xmlregexp.c xpath.c: end of first
  pass on coverity reports.
Daniel
2006-03-10 00:36:23 +00:00
Daniel Veillard
d0271473ab compilation and doc build fixes from Michael Day Daniel
* xmlreader.c include/libxml/xmlreader.h xmlschemas.c: compilation
  and doc build fixes from Michael Day
Daniel
2006-01-02 10:22:02 +00:00
Daniel Veillard
bc4cc9da77 Gary Coady pointed a memory leak in xmlTextReaderReadInnerXml() applied
* xmlreader.c: Gary Coady pointed a memory leak in
  xmlTextReaderReadInnerXml() applied patch fixing #323864
Daniel
2005-12-12 13:26:56 +00:00
Kasimier T. Buchcik
bdadaedd88 Added xmlTextReaderSchemaValidateCtxt() to the API.
* xmlreader.c include/libxml/xmlreader.h: Added
  xmlTextReaderSchemaValidateCtxt() to the API.
2005-12-07 14:02:42 +00:00
Daniel Veillard
42ca673492 small doc patch from Aron Stansvik another doc patch for a deprecated API
* xmlreader.c: small doc patch from Aron Stansvik
* legacy.c: another doc patch for a deprecated API
Daniel
2005-12-06 22:21:46 +00:00
Daniel Veillard
47fffb40d9 fixing leak in xmlTextReaderReadString() #316924 daniel
* xmlreader.c: fixing leak in xmlTextReaderReadString() #316924
daniel
2005-09-22 11:14:43 +00:00
Daniel Veillard
8874b94cd2 added a parser XML_PARSE_COMPACT option to allocate small text nodes (less
* HTMLparser.c parser.c SAX2.c debugXML.c tree.c valid.c xmlreader.c
  xmllint.c include/libxml/HTMLparser.h include/libxml/parser.h:
  added a parser XML_PARSE_COMPACT option to allocate small
  text nodes (less than 8 bytes on 32bits, less than 16bytes on 64bits)
  directly within the node, various changes to cope with this.
* result/XPath/tests/* result/XPath/xptr/* result/xmlid/*: this
  slightly change the output
Daniel
2005-08-25 13:19:21 +00:00
Daniel Veillard
45b97e72d1 applied another patch from Rob Richards to fix xmlTextReaderGetAttributeNs
* xmlreader.c: applied another patch from Rob Richards to fix
  xmlTextReaderGetAttributeNs and xmlTextReaderMoveToAttributeNs
Daniel
2005-08-20 21:14:28 +00:00
Daniel Veillard
3c40e61b7e applied patch from Rob Richards to fix xmlTextReaderGetAttribute behaviour
* xmlreader.c: applied patch from Rob Richards to fix
  xmlTextReaderGetAttribute behaviour with namespace declarations
Daniel
2005-08-17 07:07:44 +00:00
Daniel Veillard
c4ff83279c applied patch from Rob Richards fixing xmlTextReaderGetAttribute Daniel
* xmlreader.c: applied patch from Rob Richards fixing
  xmlTextReaderGetAttribute
Daniel
2005-08-08 07:45:23 +00:00
Daniel Veillard
75e389d4e0 more cleanups based on sparse reports, added "make sparse" Daniel
* Makefile.am globals.c parserInternals.c xmlreader.c xmlunicode.c
  xmlwriter.c: more cleanups based on sparse reports, added
  "make sparse"
Daniel
2005-07-29 22:02:24 +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
f10ae12cb8 fixed a typo pointed by Jeroen Ruigrok increased the APIs for xmlReader
* doc/xmllint.1 doc/xmllint.html doc/xmllint.xml: fixed a typo
  pointed by Jeroen Ruigrok
* include/libxml/xmlreader.h include/libxml/xmlschemas.h: increased
  the APIs for xmlReader schemas validation support
* xmllint.c xmlreader.c xmlschemas.c: xmlReader schemas validation
  implementation and testing as xmllint --stream --schema ...
Daniel
2005-07-10 19:03:16 +00:00
Daniel Veillard
da6f4af38a applied patch from Rob Richards for removal of ID (and xml:id) applied
* tree.c valid.c: applied patch from Rob Richards for removal
  of ID (and xml:id)
* xmlreader.c: applied patch from James Wert implementing
  xmlTextReaderReadInnerXml and xmlTextReaderReadOuterXml
Daniel
2005-06-20 17:17:54 +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
Daniel Veillard
5963aa79d4 applied fix for xmlTextReaderNext() bug from Rob Richards Daniel
* xmlreader.c: applied fix for xmlTextReaderNext() bug from
  Rob Richards
Daniel
2005-03-10 12:23:24 +00:00
Daniel Veillard
5e094143e4 applied patch from Aron Stansvik to add xmlTextReaderByteConsumed() added
* xmlreader.c include/libxml/xmlreader.h: applied patch from
  Aron Stansvik to add xmlTextReaderByteConsumed()
* testReader.c: added a test option
* xmlschemastypes.c: fix a lack of pointer checking in APIs
Daniel
2005-02-18 19:36:12 +00:00
Daniel Veillard
e125b3163b implementation of xmlTextReaderReadString by Bjorn Reese Daniel
* xmlreader.c: implementation of xmlTextReaderReadString by
  Bjorn Reese
Daniel
2005-01-28 17:39:49 +00:00
Daniel Veillard
f6b71bd176 making DSO support an option code and documentation cleanups regenerated
* configure.in: making DSO support an option
* xmlmodule.c xmlreader.c include/libxml/xmlmodule.h: code
  and documentation cleanups
* elfgcchack.h testapi.c doc/*: regenerated the docs and
  checks for new module
* test/valid/REC-xml-19980210.xml: fix a small change introduced
  previously
Daniel
2005-01-04 17:50:14 +00:00
Aleksey Sanin
d671e2863e GetLineNumber and GetColumnNumber functions for xmlReader 2005-01-03 21:58:59 +00:00
Daniel Veillard
6bb3e86d2c added xmlDictExists() to the dictionnary interface. applying
* dict.c include/libxml/dict.h: added xmlDictExists() to the
  dictionnary interface.
* xmlreader.c: applying xmlTextReaderHasAttributes fix for namespaces
  from Rob Richards
Daniel
2004-11-24 12:39:00 +00:00
Daniel Veillard
d5cc0f7f51 augmented types supported a number of new bug fixes and documentation
* gentest.py testapi.c: augmented types supported
* HTMLtree.c tree.c xmlreader.c xmlwriter.c: a number of new
  bug fixes and documentation updates.
Daniel
2004-11-06 19:24:28 +00:00
Daniel Veillard
ce682bc24b autogenerate a minimal NULL value sequence for unknown pointer types This
* gentest.py testapi.c: autogenerate a minimal NULL value sequence
  for unknown pointer types
* HTMLparser.c SAX2.c chvalid.c encoding.c entities.c parser.c
  parserInternals.c relaxng.c valid.c xmlIO.c xmlreader.c
  xmlsave.c xmlschemas.c xmlschemastypes.c xmlstring.c xpath.c
  xpointer.c: This uncovered an impressive amount of entry points
  not checking for NULL pointers when they ought to, closing all
  the open gaps.
Daniel
2004-11-05 17:22:25 +00:00
Daniel Veillard
dd6d300896 more fixes and extending the tests coverage adding a type init interface
* gentest.py testapi.c: more fixes and extending the tests coverage
* relaxng.c include/libxml/relaxng.h: adding a type init interface
* include/libxml/xmlerror.h parser.c xmlreader.c xmlwriter.c: more
  cleanups and bug fixes raised by the regression tests
Daniel
2004-11-03 14:20:29 +00:00
Daniel Veillard
e2811270e8 applied patch from Graham Bennett adding 4 convenience functions to the
* include/libxml/xmlreader.h xmlreader.c: applied patch from
  Graham Bennett adding 4 convenience functions to the reader API.
Daniel
2004-10-19 09:04:23 +00:00
Daniel Veillard
c14c3892a2 added help for new set shell command added parser option to not generate
* debugXML.c: added help for new set shell command
* xinclude.c xmllint.c xmlreader.c include/libxml/parser.h:
  added parser option to not generate XInclude start/end nodes,
  added a specific option to xmllint to test it fixes #130769
* Makefile.am: regression test the new feature
* doc/xmllint.1 doc/xmllint.xml: updated man page to document option.
Daniel
2004-08-16 12:34:50 +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
42331a9029 further fixes for out of memory condition, mostly from Olivier Andrieu.
* SAX2.c, tree.c, uri.c, xmlIO.c, xmlreader.c: further
  fixes for out of memory condition, mostly from Olivier
  Andrieu.
* testOOM.c: some further improvement by Olivier, with
  a further small enhancement for easier debugging.
2004-07-29 07:07:16 +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
1af55583ed fixed problem with reader state after processing attributes (bug 147993)
* xmlreader.c: fixed problem with reader state after
  processing attributes (bug 147993)
2004-07-22 17:18:00 +00:00