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

402 Commits

Author SHA1 Message Date
Martin Trappel
f370310542 Fix a const warning in xmlNodeSetBase
* tree.c: xmlNodeSetName: Remove const from declaration since it is
  used non-const anyway. Remove unnecessary cast on xmlFree later on.
2010-01-22 12:08:00 +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
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
ee20cd7ec9 574017 Realloc too expensive on most platform
* tree.c: even on BSD there is too much of a penalty hit, to use
  the doubling buffer size strategy on all arches not just Windows.
2009-08-22 15:18:31 +02:00
Daniel Veillard
8ed1072c2d Add symbol versioning to libxml2 shared libs
* libxml2.syms: the symbols with history, going back to 2.4.30
* Makefile.am configure.in: linking flags detection and use
* parser.c tree.c valid.c xpointer.c: various cleanup of functions
  which could be made static or simply discarded, not that many
2009-08-20 19:17:36 +02:00
Petr Pajas
2afca4a1c4 Preserve attributes of include start on tree copy
* tree.c: copy attributes and namespaces for that kind of node
2009-07-30 17:47:32 +02:00
Daniel Veillard
ab2a763db8 A bit of cleanups
* tree.c: avoid calling xmlAddID with NULL values
* parser.c: add a few xmlInitParser in some entry points
2009-07-09 08:45:03 +02:00
Daniel Veillard
43bc89c1e3 add a missing check in xmlAddSibling, patch by Kris Breuker avoid
* tree.c: add a missing check in xmlAddSibling, patch by Kris Breuker
* xmlIO.c: avoid xmlAllocOutputBuffer using XML_BUFFER_EXACT which
  leads to performances problems especially on Windows.
daniel

svn path=/trunk/; revision=3820
2009-03-23 19:32:04 +00:00
Rob Richards
810a78b305 set doc on last child tree in xmlAddChildList for bug #546772. Fix problem
* tree.c: set doc on last child tree in xmlAddChildList for 
  bug #546772. Fix problem adding an attribute via with xmlAddChild 
  reported by Kris Breuker.

svn path=/trunk/; revision=3806
2008-12-31 22:13:57 +00:00
Daniel Veillard
be2bd6ac6f adds element traversal support avoid a warning regenerated daniel
* include/libxml/tree.h tree.c python/generator.py: adds
  element traversal support
* valid.c: avoid a warning
* doc/*: regenerated
daniel

svn path=/trunk/; revision=3804
2008-11-27 15:26:28 +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
da3fee406d Borland C fix from Moritz Both regenerate, workaround a problem for buffer
* trionan.c: Borland C fix from Moritz Both
* testapi.c: regenerate, workaround a problem for buffer testing
* xmlIO.c HTMLtree.c: new internal entry point to hide even better
  xmlAllocOutputBufferInternal
* tree.c: harden the code around buffer allocation schemes
* parser.c: restore the warning when namespace names are not absolute
  URIs
* runxmlconf.c: continue regression tests if we get the expected
  number of errors
* Makefile.am: run the python tests on make check
* xmlsave.c: handle the HTML documents and trees
* python/libxml.c: convert python serialization to the xmlSave APIs
  and avoid some horrible hacks
Daniel

svn path=/trunk/; revision=3790
2008-09-01 13:08:57 +00:00
Daniel Veillard
1572425c27 preparing 2.7.0 release remove some testing traces remove some warnings
* configure.in, doc/*: preparing 2.7.0 release
* tree.c: remove some testing traces
* parser.c xmlIO.c xmlschemas.c: remove some warnings
Daniel

svn path=/trunk/; revision=3788
2008-08-30 15:01:04 +00:00
Daniel Veillard
e83e93e715 make a new kind of buffer where shrinking and adding in head can avoid
* include/libxml/tree.h tree.c: make a new kind of buffer where
  shrinking and adding in head can avoid reallocation or full
  buffer memmoves
* encoding.c xmlIO.c: use the new kind of buffers for output
  buffers
Daniel

svn path=/trunk/; revision=3787
2008-08-30 12:52:26 +00:00
Daniel Veillard
2cba415895 fix a small initialization problem raised by Ashwin increase testing
* threads.c: fix a small initialization problem raised by Ashwin
* testapi.c gentest.py: increase testing especially for document
  with an internal subset, and entities
* tree.c: fix a deallocation issue when unlinking entities from
  a document.
* valid.c: fix a missing entry point test not found previously.
* doc/*: regenerated the APIs, docs etc.
daniel

svn path=/trunk/; revision=3778
2008-08-27 11:45:41 +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
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
ed939f8e06 fix a bug introduced when fixing #438208 and reported by Ashwin fix an
* tree.c: fix a bug introduced when fixing #438208 and reported by
  Ashwin
* python/generator.py: fix an infinite loop bug
Daniel

svn path=/trunk/; revision=3733
2008-04-08 08:20:08 +00:00
Daniel Veillard
8f6c2b1163 fix some problems with the *EatName functions when running out of memory
* tree.c: fix some problems with the *EatName functions when
  running out of memory raised by Eric Schrock , should fix #438208
Daniel

svn path=/trunk/; revision=3729
2008-04-03 11:17:21 +00:00
Daniel Veillard
6f8611fdb4 patch from Julien Charbon to simplify the processing of xmlSetProp()
* include/libxml/xmlerror.h tree.c: patch from Julien Charbon
  to simplify the processing of xmlSetProp()
Daniel

svn path=/trunk/; revision=3694
2008-02-15 08:33:21 +00:00
William M. Brack
38d452ac1c Fixed typo in xmlCharEncFirstLine pointed out by Mark Rowe (bug #440159)
* encoding.c: Fixed typo in xmlCharEncFirstLine pointed out
  by Mark Rowe (bug #440159)
* include/libxml/xmlversion.h.in: Added check for definition of
  _POSIX_C_SOURCE to avoid warnings on Apple OS/X (patch from
  Wendy Doyle and Mark Rowe, bug #346675)
* schematron.c, testapi.c, tree.c, xmlIO.c, xmlsave.c: minor
  changes to fix compilation warnings - no change to logic.

svn path=/trunk/; revision=3618
2007-05-22 16:00:06 +00:00
Daniel Veillard
c9923324e9 Richard Jones reported xmlBufferAdd (buf, "", -1), fixing it Daniel
* tree.c: Richard Jones reported xmlBufferAdd (buf, "", -1), fixing it
Daniel

svn path=/trunk/; revision=3605
2007-04-24 18:12:06 +00:00
Daniel Veillard
0e05f4c2e0 applied documentation patches from Markus Keim fixed one bug and added a
* tree.c: applied documentation patches from Markus Keim
* xmlregexp.c: fixed one bug and added a couple of optimisations
  while working on bug #362989
Daniel
2006-11-01 15:33:04 +00:00
Daniel Veillard
26a45c815a fix comment for xmlDocSetRootElement c.f. #351981 order XPath elements
* tree.c: fix comment for xmlDocSetRootElement c.f. #351981
* xmllint.c: order XPath elements when using --shell
Daniel
2006-10-20 12:55:34 +00:00
Daniel Veillard
b5f1197ce2 fixing bug #344390 with xmlReconciliateNs Daniel
* tree.c: fixing bug #344390 with xmlReconciliateNs
Daniel
2006-10-14 08:46:40 +00:00
Daniel Veillard
f1a27c659e added --html --memory to test htmlReadMemory to test #321632 added various
* xmllint.c: added --html --memory to test htmlReadMemory to
  test #321632
* HTMLparser.c: added various initialization calls which may help
  #321632 but not conclusive
* testapi.c tree.c include/libxml/tree.h: fixed compilation with
  --with-minimum --with-sax1 and --with-minimum --with-schemas
  fixing #326442
Daniel
2006-10-13 22:33:03 +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
Rob Richards
a02f199d7b xmlTextConcat works with comments and PI nodes (bug #355962). fix
* tree.c: xmlTextConcat works with comments and PI nodes (bug #355962).
* parser.c: fix resulting tree corruption when using XML namespace
  with existing doc in xmlParseBalancedChunkMemoryRecover.
2006-09-16 14:04:26 +00:00
Kasimier T. Buchcik
978039bbd8 Fixed a bug in xmlDOMWrapAdoptNode(); the tree traversal stopped if the
* tree.c include/libxml/tree.h: Fixed a bug in
  xmlDOMWrapAdoptNode(); the tree traversal stopped if the
  very first given node had an attribute node :-( This was due
  to a missed check in the traversal mechanism.
  Expanded the xmlDOMWrapCtxt: it now holds the namespace map
  used in xmlDOMWrapAdoptNode() and xmlDOMWrapCloneNode() for
  reusal; so the map-items don't need to be created for every
  cloning/adoption. Added a callback function to it for
  retrieval of xmlNsPtr to be set on node->ns; this is needed
  for my custom handling of ns-references in my DOM wrapper.
  Substituted code which created the XML namespace decl on
  the doc for a call to xmlTreeEnsureXMLDecl(). Removed
  those nastly "warnigns" from the docs of the clone/adopt
  functions; they work fine on my side.
2006-06-16 19:46:26 +00:00
Kasimier T. Buchcik
43ceb1ec88 Got rid of a compiler warning in xmlGetNodePath().
* tree.c: Got rid of a compiler warning in xmlGetNodePath().
2006-06-12 11:08:18 +00:00
Kasimier T. Buchcik
d38c63f329 Fixed xmlGetNodePath() to generate the node test "*" for elements in the
* tree.c: Fixed xmlGetNodePath() to generate the node test "*"
  for elements in the default namespace, rather than generating
  an unprefixed named node test and loosing the namespace
  information.
2006-06-12 10:58:24 +00:00
Rob Richards
a512d76edc Revert behavior change in xmlSetProp to handle attributes with colons in
* tree.c: Revert behavior change in xmlSetProp to handle attributes
  with colons in name and no namespace.
2006-05-22 11:34:44 +00:00
Daniel Veillard
b2f8f1de7a preparing 2.6.24 release, fixed Python paths at the last moment fix some
* NEWS configure.in doc//*: preparing 2.6.24 release, fixed Python
  paths at the last moment
* relaxng.c testapi.c tree.c: fix some comments
Daniel
2006-04-28 16:30:48 +00:00
Daniel Veillard
973dceb768 fix compilation without tree Daniel
* tree.c: fix compilation without tree
Daniel
2006-04-25 20:22:20 +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
Kasimier T. Buchcik
4435341da4 Simplified usage of the internal xmlNsMap. Added a "strict" lookup for
* tree.c: Simplified usage of the internal xmlNsMap. Added a
  "strict" lookup for namespaces based on a prefix. Fixed a
  namespace processing issue in the clone-node function, which
  occured if a @ctxt argument was given.
2006-03-06 13:26:16 +00:00
Kasimier T. Buchcik
30f874d7e6 Bundled lookup of attr-nodes and retrieving their values into the
* tree.c: Bundled lookup of attr-nodes and retrieving their
  values into the functions xmlGetPropNodeInternal() and
  xmlGetPropNodeValueInternal(). Changed relevant code
  to use those functions.
2006-03-02 18:04:29 +00:00
Rob Richards
6581512a0c Fix the add sibling functions when passing attributes. Modify testing for
* tree.c: Fix the add sibling functions when passing attributes.
  Modify testing for ID in xmlSetProp.
  No longer remove IDness when unlinking or replacing an attribute.
2006-02-25 17:13:33 +00:00
Kasimier T. Buchcik
eb46870850 Fixed bug #328896 reported by Liron. The path for text- and
* tree.c: Fixed bug #328896 reported by Liron. The path
  for text- and CDATA-section-nodes was computed incorrectly
  in xmlGetNodePath().
2006-02-15 10:57:50 +00:00
Kasimier T. Buchcik
cab801b163 Added an initial version of xmlDOMWrapCloneNode() to the API. It will be
* tree.c: Added an initial version of xmlDOMWrapCloneNode() to
  the API. It will be used to reflect DOM's Node.cloneNode and
  Document.importNode methods.
  The pros: 1) non-recursive, 2) optimized ns-lookup
  (mostly pointer comparison), 3) user defined ns-lookup,
  4) save ns-processing. The function is in an unfinished
  and experimental state and should be only used to test it.
2006-02-03 16:35:27 +00:00
Kasimier T. Buchcik
e8f8d75166 Fixed some bugs xmlDOMWrapReconcileNamespaces() wrt the previous addition
* tree.c: Fixed some bugs xmlDOMWrapReconcileNamespaces() wrt
  the previous addition of the removal of redundant ns-decls.
2006-02-02 12:13:07 +00:00
Kasimier T. Buchcik
e01b2fd776 Enhanced xmlDOMWrapReconcileNamespaces() to remove redundant ns-decls if
* tree.c: Enhanced xmlDOMWrapReconcileNamespaces() to remove
  redundant ns-decls if the option XML_DOM_RECONNS_REMOVEREDUND
  was given. Note that I haven't moved this option to the
  header file yet; so just call this function with an @option
  of 1 to test the behaviour.
2006-02-01 16:36:13 +00:00
Rob Richards
77b92ff6a8 fix bug #322136 in xmlNodeBufGetContent when entity ref is a child of an
* tree.c: fix bug #322136 in xmlNodeBufGetContent when entity ref is
  a child of an element (fix by Oleksandr Kononenko).
* HTMLtree.c include/libxml/HTMLtree.h: Add htmlDocDumpMemoryFormat.
2005-12-20 15:55:14 +00:00
Rob Richards
19dc961ec1 add additional checks to prevent tree corruption. fix problem copying
* tree.c: add additional checks to prevent tree corruption. fix problem
  copying attribute using xmlDocCopyNode from one document to another.
2005-10-28 16:15:16 +00:00
Rob Richards
c342ec6d6d fix issue adding non-namespaced attributes in xmlAddChild(),
* tree.c: fix issue adding non-namespaced attributes in xmlAddChild(),
  xmlAddNextSibling() and xmlAddPrevSibling() (bug #319108) - part 1.
2005-10-25 00:10:12 +00:00
Kasimier T. Buchcik
65c2f1d78a Silenced intel compiler warnings (reported by Kjartan Maraas, bug
* tree.c pattern.c: Silenced intel compiler warnings (reported
  by Kjartan Maraas, bug #318517).
* xmlschemas.c: The above changes in pattern.c revealed an
  inconsistency wrt IDCs: we now _only_ pop XPath states, if
  we really pushed them beforehand; this was previously not
  checked for the case when we discover an element node to be
  invalid wrt the content model.
  Fixed segfault in xmlSchemaGetEffectiveValueConstraint().
2005-10-17 12:39:58 +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