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

77 Commits

Author SHA1 Message Date
Tim Elliott
71a243d5b4 xmlParseNodeInContext problems with an empty document
When you call xmlParseNodeInContext on a fragment node with an
empty document, the parser associates the first new node twice --
once with the document, and once with the fragment node.

This fixes the issue by only associating the new node with the
fragment node.
2012-05-08 13:19:40 +08:00
Pavel Andrejs
8ad4da5f56 HTML element position is not detected propperly
The data in node_seq in xmlParserCtxt was not updated properly
when parsing HTML. This patch fixes the accounting for both
pull and push mode of HTML parsing.
2012-05-08 11:01:12 +08:00
Daniel Veillard
1c989278d9 Fix SAX2 builder in case of undefined attributes namespace
To follow the early XML-1.0 REC, the new localname is "prefix:localname"
and there is obviously now namespace.
2012-01-26 19:43:06 +08:00
Daniel Veillard
77b77b1301 Fix SAX2 builder in case of undefined element namespaces
Work as in XML-1.0 before namespaces, and use prefix:localname
as the new element name (and no namespace of course)
Also fix 3 cases in the regression tests where the prefix: was
erroneously dropped in such case
2012-01-26 19:11:02 +08:00
Daniel Veillard
aa54d37cd7 Fix handling of XML-1.0 XML namespace declaration
Usually 'xml' namespace for XML-1.0 declaration does not need
to be carried but Mike Hommey raised the problem that the SVG
XSD file fails to parse due to a mishandling.
- SAX2.c: failure to create a namespace should not be interpreted
  as a memory allocation error
- tree.c: document better xmlNewNs behaviour, and fix it in the
  case the 'xml' prefix is being used.
2010-09-09 18:17:47 +02:00
Daniel Veillard
06c93b7509 Remove a few warnings 2010-03-15 16:08:44 +01:00
Daniel Veillard
3c080d6d72 Don't give default HTML boolean attribute values in parser
* HTMLparser.c: don't default value of HTML boolean attributes in the
  parser
* SAX2.c: move this to SAX2 tree building backend
* result/HTML/doc2.htm.sax result/HTML/doc3.htm.sax
  result/HTML/wired.html.sax: this changes a few HTML SAX regression
  tests
2010-03-15 15:47:50 +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
Daniel Veillard
d44b936499 A few more safety cleanup raised by scan
* SAX2.c encoding.c parser.c xmlschemas.c: a few more safety checks
* relaxng.c: remove an unused intitialization
2009-09-07 12:15:08 +02:00
Daniel Veillard
74eaec1496 502960 provide namespace stack when parsing entity
* parser.c: copy the entity stack
* SAX2.c: fix the warning message for default entities
2009-08-26 15:57:20 +02:00
Daniel Veillard
023d0babc4 Fix leak on SAX1, xmllint --sax1 option and debug
* SAX2.c: don't leak in xmlCheckDefaultedAttributes for standalone
  checking
* xmllint.c: fix xmllint --sax1 to actually use XML_PARSE_SAX1
* debugXML.c: don't raise an error if markup wasn't allocated from
  dictionary if document was parsed with option disabling it
2009-07-29 11:34:50 +02:00
Jim Meyering
669e88c065 potential NULL dereference on non-glibc
* SAX2.c (xmlCheckDefaultedAttributes): When xmlStrdup and/or
  xmlStrcat fails due to OOM avoid printing NULL via a printf-style "%s"
  format
2009-07-29 11:33:32 +02:00
Daniel Veillard
97ff9b367a preparing 0.7.3 release fix a typo in a name Daniel
* configure.in doc/xml.html doc/*: preparing 0.7.3 release
* include/libxml/parserInternals.h SAX2.c: fix a typo in a name
Daniel

svn path=/trunk/; revision=3814
2009-01-18 21:43:30 +00:00
Daniel Veillard
1fb2e0dfc6 add a new define XML_MAX_TEXT_LENGHT limiting the maximum size of a single
* include/libxml/parserInternals.h SAX2.c: add a new define
  XML_MAX_TEXT_LENGHT limiting the maximum size of a single text
  node, the defaultis 10MB and can be removed with the HUGE
  parsing option
Daniel

svn path=/trunk/; revision=3808
2009-01-18 14:08:36 +00:00
Daniel Veillard
1dc9feb00f fix for CVE-2008-4226, a memory overflow when building gigantic text
* SAX2.c parser.c: fix for CVE-2008-4226, a memory overflow
  when building gigantic text nodes, and a bit of cleanup
  to better handled out of memory problem in that code.
* tree.c: fix for CVE-2008-4225, lack of testing leads to
  a busy loop test assuming one have enough core memory.
Daniel

svn path=/trunk/; revision=3803
2008-11-17 15:59:21 +00:00
Daniel Veillard
f4f4e4853a rework the patch to avoid some ABI issue with people allocating entities
* include/libxml/entities.h entities.c SAX2.c parser.c: rework
  the patch to avoid some ABI issue with people allocating
  entities structure directly
Daniel

svn path=/trunk/; revision=3773
2008-08-25 08:57:48 +00:00
Daniel Veillard
ae0765b681 more progresses against the official regression tests small cleanup for
* runxmlconf.c: more progresses against the official regression tests
* runsuite.c: small cleanup for non-leak reports
* include/libxml/tree.h: parsing flags and other properties are
  now added to the document node, this is generally useful and
  allow to make Name and NmToken validations based on the parser
  flags, more specifically the 5th edition of XML or not
* HTMLparser.c tree.c: small side effects for the previous changes
* parser.c SAX2.c valid.c: the bulk of teh changes are here,
  the parser and validation behaviour can be affected, parsing
  flags need to be copied, lot of changes. Also fixing various
  validation problems in the regression tests.
Daniel

svn path=/trunk/; revision=3762
2008-07-31 19:54:59 +00:00
Daniel Veillard
45efd0878a fix line number on text nodes, problem raised by Ralf Junker Daniel
* SAX2.c: fix line number on text nodes, problem raised by Ralf Junker
Daniel

svn path=/trunk/; revision=3751
2008-07-07 13:52:52 +00:00
Daniel Veillard
b242b08831 applied patch from Florent Guilian to remove an useless mutex in the
* dict.c: applied patch from Florent Guilian to remove an
  useless mutex in the xmlDict structure.

older, not commited ...

* SAX2.c: another leak reported by Ashwin
* xinclude.c: fixed the behaviour when XIncluding a fragment
  of the current document, patch from Chris Ryan

Daniel


svn path=/trunk/; revision=3686
2008-02-08 09:56:31 +00:00
Daniel Veillard
dbbd72bd75 fixing bug #319964, parsing of HTML attribute really should not have
* SAX2.c: fixing bug #319964, parsing of HTML attribute really
  should not have namespace processing.
Daniel

svn path=/trunk/; revision=3637
2007-06-12 15:15:52 +00:00
Daniel Veillard
a37a6ad91a trying to fix entities behaviour when using SAX, had to extend entities
* include/libxml/entities.h entities.c SAX2.c parser.c: trying to
  fix entities behaviour when using SAX, had to extend entities
  content and hack on the entities processing code, but that should
  fix the long standing bug #159219
Daniel
2006-10-10 20:05:45 +00:00
Daniel Veillard
b8efdda0a3 add a new function xmlPathToUri() to provide a clean conversion when
* uri.c include/libxml/uri.h: add a new function xmlPathToUri()
  to provide a clean conversion when setting up a base
* SAX2.c tree.c: use said function when setting up doc->URL
  or using the xmlSetBase function. Should fix #346261
Daniel
2006-10-10 12:37:14 +00:00
Daniel Veillard
77aad34c94 refactor to use normal warnings for entities problem and not straight SAX
* SAX2.c: refactor to use normal warnings for entities problem
  and not straight SAX callbacks.
Daniel
2006-07-13 06:21:09 +00:00
Daniel Veillard
2728f845c5 more cleanups based on coverity reports. Daniel
* SAX2.c catalog.c encoding.c entities.c example/gjobread.c
  python/libxml.c: more cleanups based on coverity reports.
Daniel
2006-03-09 16:49:24 +00:00
Daniel Veillard
6977c6c437 fix bug #324432 with <xml:foo/> added to the regression tests Daniel
* SAX2.c: fix bug #324432 with <xml:foo/>
* test/ns7 resul//ns7*: added to the regression tests
Daniel
2006-01-04 14:03:10 +00:00
Daniel Veillard
54f9a4f508 fixing a number of issues raised by xml:id but more generally related to
* SAX2.c tree.c valid.c: fixing a number of issues raised by xml:id
  but more generally related to attributes and ID handling, fixes
  #314358 among other things
Daniel
2005-09-03 13:28:24 +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
73da77e0d7 line numbers are now carried by most nodes, fixing xmlGetLineNo() c.f. bug
* SAX2.c tree.c: line numbers are now carried by most nodes, fixing
  xmlGetLineNo() c.f. bug #309205
Daniel
2005-08-24 14:05:37 +00:00
Daniel Veillard
bca3ad25f9 fixed compilation when configured --without-sax1 and other cleanups fixes
* SAX2.c globals.c runtest.c testC14N.c testapi.c tree.c
  include/libxml/SAX2.h include/libxml/xmlregexp.h: fixed compilation
  when configured --without-sax1 and other cleanups fixes bug #172683
* doc/* elfgcchack.h: regenerated
Daniel
2005-08-23 22:14:02 +00:00
Daniel Veillard
24505b0f5c a lot of small cleanups based on Linus' sparse check output. Daniel
* HTMLparser.c SAX2.c encoding.c globals.c parser.c relaxng.c
  runsuite.c runtest.c schematron.c testHTML.c testReader.c
  testRegexp.c testSAX.c testThreads.c valid.c xinclude.c xmlIO.c
  xmllint.c xmlmodule.c xmlschemas.c xpath.c xpointer.c: a lot of
  small cleanups based on Linus' sparse check output.
Daniel
2005-07-28 23:49:35 +00:00
Daniel Veillard
87b3046bc1 first steps toward a testsuite dist fixed bug #307870 Daniel
* Makefile.am: first steps toward a testsuite dist
* SAX2.c include/libxml/xmlerror.h: fixed bug #307870
Daniel
2005-07-05 14:04:36 +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
a521d28751 better handling of conditional features more testing on parser contexts
* gentest.py testapi.c: better handling of conditional features
* HTMLparser.c SAX2.c parserInternals.c xmlwriter.c: more testing
  on parser contexts closed leaks, error messages
Daniel
2004-11-09 14:59:59 +00:00
Daniel Veillard
6128c01ca6 better parser options coverage more cleanups. Daniel
* gentest.py testapi.c: better parser options coverage
* SAX2.c xpath.c: more cleanups.
Daniel
2004-11-08 17:16:15 +00:00
Daniel Veillard
2a4fb5ac07 more coverage more fixes Daniel
* gentest.py testapi.c: more coverage
* SAX2.c parser.c parserInternals.c: more fixes
Daniel
2004-11-08 14:02:18 +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
34099b4031 changing the way the .c is generated, extending the tests coverage fixing
* gentest.py testapi.c: changing the way the .c is generated,
  extending the tests coverage
* include/libxml/nanoftp.h nanoftp.c elfgcchack.h doc/*: fixing some
  function signatures, regenerating stuff
* SAX2.c parser.c xmlIO.c: another set of bug fixes and API hardening
Daniel
2004-11-04 17:34:35 +00:00
Daniel Veillard
36e5cd5064 adding xmlMemBlocks() work on generator of an automatic API regression
* xmlmemory.c include/libxml/xmlmemory.h: adding xmlMemBlocks()
* Makefile.am gentest.py testapi.c: work on generator of an
  automatic API regression test tool.
* SAX2.c nanoftp.c parser.c parserInternals.c tree.c xmlIO.c
  xmlstring.c: various API hardeing changes as a result of running
  teh first set of automatic API regression tests.
* test/slashdot16.xml: apparently missing from CVS, commited it
Daniel
2004-11-02 14:52:23 +00:00
Daniel Veillard
eff45a92da register xmlSchemaSetValidErrors, patch from Brent Hendricks in the
* python/libxml.c: register xmlSchemaSetValidErrors, patch from
  Brent Hendricks in the mailing-list
* include/libxml/valid.h HTMLparser.c SAX2.c valid.c
  parserInternals.c: fix #156626 and more generally how to find out
  if a validation contect is part of a parsing context or not. This
  can probably be improved to make 100% sure that vctxt->userData
  is the parser context too. It's a bit hairy because we can't
  change the xmlValidCtxt structure without breaking the ABI since
  this change xmlParserCtxt information indexes.
Daniel
2004-10-29 12:10:55 +00:00
Daniel Veillard
03a53c34db added checking for names values and dictionnaries generates a tons of
* debugXML.c include/libxml/xmlerror.h: added checking for names
  values and dictionnaries generates a tons of errors
* SAX2.ccatalog.c parser.c relaxng.c tree.c xinclude.c xmlwriter.c
  include/libxml/tree.h: fixing the errors in the regression tests
Daniel
2004-10-26 16:06:51 +00:00
Daniel Veillard
fc484dd0a0 added support for HTML PIs #156087 added specific tests Daniel
* HTMLparser.c: added support for HTML PIs #156087
* test/HTML/python.html result/HTML/python.html*: added specific tests
Daniel
2004-10-22 14:34:23 +00:00
Daniel Veillard
8de5c0bd79 adding the tree debug mode fixing various problems reported by the debug
* debugXML.c include/libxml/debugXML.h include/libxml/xmlerror.h:
  adding the tree debug mode
* parser.c relaxng.c tree.c xpath.c: fixing various problems reported
  by the debug mode.
* SAX2.c: another tree fix from Rob Richards
Daniel
2004-10-07 13:14:19 +00:00
William M. Brack
bf5cf2196c fixed bug introduced during OOM fixup causing problems with default
* SAX2.c: fixed bug introduced during OOM fixup causing problems
  with default namespace when a named prefix with the same href
  was present (reported on the mailing list by Karl Eichwalder.
* xmlstring.c: modified xmlCheckUTF8 with suggested code from
  Julius Mittenzwei.
* dict.c: added a typecast to try to avoid problem reported by
  Pascal Rodes.
2004-08-31 06:47:17 +00:00
Daniel Veillard
29b1748205 small typo pointed out by Mike Hommey slightly improved the --c14n
* xmlIO.c: small typo pointed out by Mike Hommey
* doc/xmllint.xml, xmllint.html, xmllint.1: slightly improved
  the --c14n description, c.f. #144675 .
* nanohttp.c nanoftp.c: applied a first simple patch from
  Mike Hommey for $no_proxy, c.f. #133470
* parserInternals.c include/libxml/parserInternals.h
  include/libxml/xmlerror.h: cleanup to avoid 'error' identifier
  in includes #
* parser.c SAX2.c debugXML.c include/libxml/parser.h:
  first version of the inplementation of parsing within
  the context of a node in the tree #142359, new function
  xmlParseInNodeContext(), added support at the xmllint --shell
  level as the "set" function
* test/scripts/set* result/scripts/* Makefile.am: extended
  the script based regression tests to instrument the new function.
Daniel
2004-08-16 00:39:03 +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
96d2effc73 warning message cleanup. Now compiles warning-free, all tests passed.
* xmlschemas.c, xmlschemastypes.c: warning message cleanup.
  Now compiles warning-free, all tests passed.
* SAX2.c: small change to comments for documentation.
  No change to logic.
2004-06-30 11:48:47 +00:00
William M. Brack
5ef2f8129f *** empty log message *** 2004-05-23 23:56:47 +00:00
William M. Brack
3f147372f7 skipped call to xmlValidateNCName when compiling --with-minimum (bug
* SAX2.c: skipped call to xmlValidateNCName when compiling
  --with-minimum (bug 142917)
2004-05-22 01:09:26 +00:00