Branch :
| Author | Commit | Date | CI | Message |
|---|---|---|---|---|
| a530ff12 | 2024-07-29 14:18:57 | io: Always consume encoding handler when creating output buffers Also free encoding handler in error case. Remove xmlAllocOutputBufferInternal which was identical to xmlAllocOutputBuffer. | ||
| bc14d70f | 2024-07-25 00:26:48 | xmlsave: Improve "unsupported encoding" error message Incomplete support of XML_SAVE_* error codes was removed. Error handling still needs work. xmlOutputBufferCreateFilename should return an error code. | ||
| 5862e9dd | 2024-07-18 01:59:25 | Add NULL checks Short-lived regression. | ||
| a221cd78 | 2024-07-07 03:01:51 | buf: Rework xmlBuf code Always use what the old implementation called the "IO" allocation scheme, allowing to move the content pointer past the initial allocation. This is inexpensive and allows efficient shrinking. Optimize xmlBufGrow, reusing shrunken memory as much as possible. Simplify xmlBufAdd. Make xmlBufBackToBuffer return an error on overflow. Make "size" exclude the terminating NULL byte. Always provide an initial size. Reintroduce static buffers. Remove xmlBufResize and several other functions. | ||
| 2adcde39 | 2024-07-12 16:25:05 | save: Optimize xmlSerializeText Use lookup tables. | ||
| 1b067082 | 2024-07-12 15:19:26 | save: Always serialize CR as decimal " " We used to serialize CR as "
" when there was no encoding and we weren't in an attribute. This was somewhat inconsistent. | ||
| 1cfc5b80 | 2024-07-12 03:07:57 | entities: Rework serialization of numeric character references | ||
| 8d160626 | 2024-07-12 02:01:06 | entities: Rework text escaping | ||
| cc45f618 | 2024-07-11 22:06:31 | save: Rework text escaping Stop using xmlOutputBufferWriteEscape except when using deprecated xmlSaveSetEscape. Rewrite xmlOutputBufferWriteEscape to use an extra buffer and call xmlOutputBufferWrite. Introduce xmlSerializeText to serialize both text and attribute content. Don't read encoding from document when serializing and remove all hacks that temporarily changed the document's encoding. | ||
| e488695b | 2024-07-11 20:23:49 | save: Deprecate xmlSaveSet*Escape xmlSaveSetAttrEscape never had an effect. | ||
| 673ca0ed | 2024-07-11 01:23:57 | tests: Regenerate testapi.c | ||
| 96d850c3 | 2024-07-02 22:43:49 | save: Fix "Factor out xmlSaveWriteIndent" | ||
| 35146ff3 | 2024-07-02 19:43:24 | save: Implement xmlSaveSetIndentString Allow to set indent string without using global xmlTreeIndentString. See #736. | ||
| 7cc619d5 | 2024-07-02 19:22:32 | save: Implement save options for indenting Implement XML_SAVE_NO_INDENT to disable and XML_SAVE_INDENT to enable indenting regardless of the global xmlIndentTreeOutput. Implement XML_SAVE_EMPTY to enable empty tags regardless of the global xmlSaveNoEmptyTags. See #736. | ||
| 2c4204ec | 2024-07-02 19:14:40 | save: Factor out xmlSaveWriteIndent | ||
| 202045f8 | 2024-07-02 18:51:59 | save: Pass options to xmlSaveCtxtInit | ||
| 598ee0d2 | 2024-06-26 01:18:55 | error: Remove underscores from xmlRaiseError | ||
| 5b893fa9 | 2024-06-22 19:15:17 | encoding: Fix encoding lookup with xmlOpenCharEncodingHandler Make xmlOpenCharEncodingHandler call xmlParseCharEncoding first so we prefer our own handlers for names like "UTF8". Only UTF-16 needs an exception. Make callers check the return value. For UTF-8, a NULL encoding doesn't mean an error. Remove unnecessary UTF-8 check from htmlFindOutputEncoder. Don't try to look up ASCII handler since the HTML handler is always available. Fix return code of xmlParseCharEncoding. Should fix #744. | ||
| 2def7b4b | 2024-06-18 13:55:34 | clang-tidy: move assignments out of if Found with bugprone-assignment-in-if-condition Signed-off-by: Rosen Penev <rosenp@gmail.com> | ||
| e75e878e | 2024-05-20 13:58:22 | doc: Update and fix documentation | ||
| f506ec66 | 2024-04-15 11:27:44 | parser: Always decode entities in namespace URIs Also decode entities in namespace URIs if entity substitution wasn't requested. This should fix some corner cases when comparing namespace URIs. The Namespaces in XML 1.0 spec says: > In a namespace declaration, the URI reference is the normalized value > of the attribute, so replacement of XML character and entity > references has already been done before any comparison. Make the serialization code escape special characters in namespace URIs like in attribute values. This fixes serialization if entities were substituted when parsing. Fixes https://gitlab.gnome.org/GNOME/libxslt/-/issues/106 | ||
| 20fca2bb | 2024-04-09 15:39:06 | save: Report malloc failure in xmlAttrSerializeTxtContent Flush buffer before checking for errors. | ||
| 86c27206 | 2024-04-02 14:41:15 | save: Handle invalid parent pointers in xhtmlNodeDumpOutput See #255 and commit 85b1792e. | ||
| fb1e6302 | 2024-03-17 19:24:06 | save: Check for NULL node->name in xhtmlIsEmpty | ||
| ee0c1f87 | 2024-02-29 14:51:49 | fuzz: New tree API fuzzer | ||
| 10c202f9 | 2024-03-04 01:31:12 | malloc-fail: Check for NULL pointer in xmlSaveNotation* | ||
| b1e75a91 | 2024-03-05 20:00:44 | save: Report malloc failure in xmlAttrSerializeTxtContent | ||
| 3494aa4f | 2024-03-04 01:39:00 | save: Cast return code of xmlBufNodeDump Avoid implicit sign change. | ||
| 1d392fab | 2024-03-05 18:06:02 | save: Check for output buffer errors Report more error conditions. | ||
| d2f7ca53 | 2024-03-03 16:51:07 | save: Add range check for level in xmlNodeDump | ||
| e314109a | 2024-02-16 15:42:38 | save: Don't write directly to internal buffer Make sure that OOM errors are reported. | ||
| fbe10a46 | 2024-02-01 19:01:57 | save: Move DTD serialization code to xmlsave.c | ||
| c2b3294f | 2024-01-04 21:20:51 | fuzz: Abort on invalid UTF-8 The parser should never generate invalid UTF-8 these days even in recovery mode. | ||
| ca5965d5 | 2024-01-02 21:49:43 | save: Report more malloc failures | ||
| 0821efc8 | 2024-01-02 18:33:57 | encoding: Check whether encoding handlers support input/output The "HTML" encoding handler doesn't support input which could lead to a wrong error report. | ||
| 4dcc2d74 | 2024-01-02 14:04:44 | save: Output U+FFFD replacement characters This degrades more gracefully and helps to diagnose errors. We stop raising errors for now, since there's no way to report malloc failures during error handling yet. | ||
| bc1e0306 | 2023-12-18 21:30:22 | save: Improve error handling Handle malloc failrue from xmlRaiseError. Use xmlRaiseMemoryError. Stop using xmlGenericError. Remove argument from memory error handler. Remove TODO macro. | ||
| 6c8acdec | 2023-12-14 13:37:43 | save: Fix build --without-html Fixes #646 | ||
| 0d97e439 | 2023-12-10 17:14:57 | save: Report malloc failures Fix places where malloc failures aren't report. Introduce a new API function xmlSaveFinish which returns an error code. | ||
| 8c084ebd | 2023-09-21 22:57:33 | doc: Make apibuild.py happy | ||
| da274bfa | 2023-09-21 01:29:40 | build: Fix build when certain modules are disabled | ||
| 4e1c13eb | 2023-09-18 14:45:10 | debug: Remove debugging code This is barely useful these days and only clutters the code base. | ||
| c82701ff | 2023-02-14 15:13:06 | malloc-fail: Fix memory leak in xmlDocDumpFormatMemoryEnc Found with libFuzzer, see #344. | ||
| bdcf842c | 2022-09-01 20:45:35 | Move xmlIsXHTML to tree.c It's declared in tree.h and not guarded by LIBXML_OUTPUT_ENABLED like the other functions in xmlsave.c. | ||
| ad338ca7 | 2022-09-01 01:18:30 | Remove explicit integer casts Remove explicit integer casts as final operation - in assignments - when passing arguments - when returning values Remove casts - to the same type - from certain range-bound values The main motivation is that these explicit casts don't change the result of operations and only render UBSan's implicit-conversion checks useless. Removing these casts allows UBSan to detect cases where truncation or sign-changes occur unexpectedly. Document some explicit casts as truncating and add a few missing ones. | ||
| 0f568c0b | 2022-08-26 01:22:33 | 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. | ||
| 3e7b4f37 | 2022-05-20 23:28:25 | Avoid calling xmlSetTreeDoc Create text nodes with xmlNewDocText or set the document directly to avoid xmlSetTreeDoc being called when the node is inserted. | ||
| d99ddd9b | 2022-03-05 21:46:40 | Improve buffer allocation scheme In most places, we really need the double-it scheme to avoid quadratic behavior. The hybrid scheme still can cause many reallocations and the bounded scheme doesn't seem to provide meaningful protection in xmlreader.c. | ||
| 346c3a93 | 2022-02-20 18:46:42 | Remove elfgcchack.h The same optimization can be enabled with -fno-semantic-interposition since GCC 5. clang has always used this option by default. | ||
| 13ad8736 | 2021-05-25 10:55:25 | Fix regression in xmlNodeDumpOutputInternal Commit 85b1792e could cause additional whitespace if xmlNodeDump was called with a non-zero starting level. | ||
| 85b1792e | 2021-05-18 20:08:28 | Work around lxml API abuse Make xmlNodeDumpOutput and htmlNodeDumpFormatOutput work with corrupted parent pointers. This used to work with the old recursive code but the non-recursive rewrite required parent pointers to be set correctly. Unfortunately, lxml relies on the old behavior and passes subtrees with a corrupted structure. Fall back to a recursive function call if an invalid parent pointer is detected. Fixes #255. | ||
| 0b3c64d9 | 2020-09-29 18:08:37 | Handle dumps of corrupted documents more gracefully Check parent pointers for NULL after the non-recursive rewrite of the serialization code. This avoids segfaults with corrupted documents which can apparently be seen with lxml, see issue #187. | ||
| 00a86d41 | 2020-08-16 23:38:00 | Don't add formatting newlines to XInclude nodes | ||
| 1a360c1c | 2020-07-29 00:39:15 | More *NodeDumpOutput fixes When leaving nodes, restrict more operations to XML_ELEMENT_NODEs. | ||
| 7b2e5172 | 2020-07-28 21:52:55 | Fix *NodeDumpOutput functions Only output end tag for elements. Should fix serialization of document fragments. | ||
| dc6f0092 | 2020-07-28 19:07:19 | Make xmlNodeDumpOutputInternal non-recursive Fixes stack overflow with deeply nested documents. | ||
| 5330153d | 2020-07-28 18:33:50 | Make xhtmlNodeDumpOutput non-recursive Fixes stack overflow with deeply nested documents. | ||
| 20c60886 | 2020-03-08 17:19:42 | Fix typos Resolves #133. | ||
| c9faa292 | 2020-01-02 14:12:39 | Fix overflow check in xmlNodeDump Store return value of xmlBufNodeDump in a size_t before checking for integer overflow. Found by lgtm.com | ||
| 42942066 | 2019-11-11 13:49:11 | Fix memory leaks of encoding handlers in xmlsave.c Fix leak of iconv/ICU encoding handler in xmlSaveToBuffer. Fix leaks of iconv/ICU encoding handlers in xmlSaveTo* error paths. Closes #127. | ||
| 2a350ee9 | 2019-09-30 17:04:54 | Large batch of typo fixes Closes #109. | ||
| 81958b6e | 2019-07-11 19:24:11 | Doc: do not mislead towards "infeasible" scenario wrt. xmlBufNodeDump At least when merely public API is to be leveraged, one cannot use xmlBufCreate function that would otherwise be a clear fit, and relying on some invariants wrt. how some other struct fields will get initialized along the construction/filling such parent struct and (ab)using that instead does not appear clever, either. Hence, instruct people what's the Right Thing for the moment, that is, make them use xmlNodeDumpOutput instead (together with likewise public xmlAllocOutputBuffer). Going forward, it's questionable what do with xmlBuf* family of functions that are once public, since they, for any practical purpose, cannot be used by the library clients (that's how I've run into this). Signed-off-by: Jan Pokorný <jpokorny@redhat.com> | ||
| 96125557 | 2019-05-10 12:30:03 | Remove unused member `doc` in xmlSaveCtxt | ||
| ee501f54 | 2018-10-13 15:23:35 | Stop using doc->charset outside parser code doc->charset does not specify the in-memory encoding which is always UTF-8. | ||
| cb5541c9 | 2017-11-13 17:08:38 | Fix libz and liblzma detection If libz or liblzma are detected with pkg-config, AC_CHECK_HEADERS must not be run because the correct CPPFLAGS aren't set. It is actually not required have separate checks for LIBXML_ZLIB_ENABLED and HAVE_ZLIB_H. Only check for LIBXML_ZLIB_ENABLED and remove HAVE_ZLIB_H macro. Fixes bug 764657, bug 787041. | ||
| 359e7504 | 2017-11-13 21:13:46 | Fix -Wmisleading-indentation warnings | ||
| 362b3229 | 2017-06-07 16:35:28 | Fix memory leak in xmlBufAttrSerializeTxtContent The serializer sets doc->encoding to a temporary value and restores the original value when it's done. This overwrites the encoding value set in xmlBufAttrSerializeTxtContent, causing a memory leak. Don't mess with doc->encoding if invalid UTF-8 is encountered. Found with libFuzzer and ASan. | ||
| c97750d1 | 2016-05-23 13:39:13 | Avoid an out of bound access when serializing malformed strings For https://bugzilla.gnome.org/show_bug.cgi?id=766414 * xmlsave.c: xmlBufAttrSerializeTxtContent() if an attribute value is not UTF-8 be more careful when serializing it as we may do an out of bound access as a result. | ||
| 23922c53 | 2013-02-11 11:52:44 | When calling xmlNodeDump make sure we grow the buffer quickly Make sure the underlying new buffer allocated use a double-it scheme for the time of the dump. | ||
| f8e3db04 | 2012-09-11 13:26:36 | Big space and tab cleanup Remove all space before tabs and space and tabs at end of lines. | ||
| 3e62adbe | 2012-08-09 14:24:02 | Adding various checks on node type though the API Specifially checking against namespace nodes before accessing node pointers | ||
| 50cdab55 | 2012-07-16 14:52:00 | New saving functions using xmlBuf and conversion * save.h: new header providing new functions currently internal and xmlBuf counterparts of old xmlBuffer based ones * xmlsave.c: convert functions to use xmlBuf as much as possible | ||
| 0795348a | 2012-01-22 17:42:35 | fix a pair of possible out of array char references When serializing char references back to an character string Reported by Abhishek Arya <inferno@chromium.org> | ||
| d2e62311 | 2010-11-03 15:33:40 | Add xmlSaveOption XML_SAVE_WSNONSIG non destructive indentation option using spaces within markup constructs and hence not modifying content * include/libxml/xmlsave.h: new option * xmlsave.c: some refactoring and new code for the new option * xmllint.c: adds --pretty option where option 2 uses the new formatting | ||
| 8b877135 | 2010-11-01 14:24:56 | Force _xmlSaveCtxt.format to be 0 or 1 * xmlsave.c: force _xmlSaveCtxt.format to be 0 or 1 and check accordingly, this will allow other values of "format" to be used for other purposes. | ||
| 594e5dfb | 2009-09-07 14:58:47 | 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) | ||
| 141ebfa0 | 2009-09-02 14:58:13 | Wrong block opening in htmlNodeDumpOutputInternal * xmlsave.c: Jim Meyering ran clang on libxml2 and this is one of the error found, misplaced curly brace | ||
| 856d9281 | 2008-09-25 14:31:40 | new options to serialize as XML/HTML/XHTML and restore old entry point * include/libxml/xmlsave.h xmlsave.c: new options to serialize as XML/HTML/XHTML and restore old entry point behaviours Daniel svn path=/trunk/; revision=3794 | ||
| da3fee40 | 2008-09-01 13:08:57 | 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 | ||
| d0d2f090 | 2008-03-07 16:50:21 | fix handling of empty CDATA nodes as reported and discussed around #514181 * xmlsave.c parser.c: fix handling of empty CDATA nodes as reported and discussed around #514181 and associated patches * test/emptycdata.xml result/emptycdata.xml* result/noent/emptycdata.xml: added a specific test in the regression suite. Daniel svn path=/trunk/; revision=3701 | ||
| a76a81f6 | 2007-10-10 08:28:18 | fix to avoid a crash when dumping an attribute from an XHTML document, * xmlsave.c: fix to avoid a crash when dumping an attribute from an XHTML document, patch contributed to fix #485298 Daniel svn path=/trunk/; revision=3660 | ||
| 3814a365 | 2007-07-26 11:41:46 | fixed problem reported on bug #460415 Daniel * xmlsave.c: fixed problem reported on bug #460415 Daniel svn path=/trunk/; revision=3646 | ||
| 38d452ac | 2007-05-22 16:00:06 | 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 | ||
| bd44484b | 2007-03-20 08:47:29 | applied patch from Björn Wiberg to try to fix again the silly * nanoftp.c: applied patch from Björn Wiberg to try to fix again the silly __ss_familly problem on various AIXes, should fix #420184 Daniel svn path=/trunk/; revision=3592 | ||
| dab39b56 | 2006-10-16 23:22:10 | started to switch xmllint to use xmlSaveDoc to test #342556 fixed #342556 * xmllint.c: started to switch xmllint to use xmlSaveDoc to test #342556 * xmlsave.c: fixed #342556 easy and a whole set of problems with encodings, BOM and xmlSaveDoc() Daniel | ||
| 681e904e | 2006-09-29 09:16:00 | fixed a comment applied a patch from Michael Day to add a new function * xmlsave.c: fixed a comment * xinclude.c include/libxml/xinclude.h: applied a patch from Michael Day to add a new function providing the _private field for the generated parser contexts xmlXIncludeProcessFlagsData() Daniel | ||
| 417b74d0 | 2006-08-15 23:14:24 | Add linefeeds to error messages allowing for consistant handling. * HTMLtree.c xmlsave.c: Add linefeeds to error messages allowing for consistant handling. | ||
| 7b4e2e20 | 2006-07-13 13:07:11 | Removed the automatic generation of CDATA sections for the content of the * xmlsave.c: Removed the automatic generation of CDATA sections for the content of the "script" and "style" elements when serializing XHTML. The issue was reported by Vincent Lefevre, bug #345147. * result/xhtml1 result/noent/xhtml1: Adjusted regression test results due to the serialization change described above. | ||
| 9a00fd29 | 2005-11-09 08:56:26 | applied patch from Geert Jansen to implement the save function to a * xmlsave.c xmlIO.c include/libxml/xmlIO.h include/libxml/xmlsave.h: applied patch from Geert Jansen to implement the save function to a xmlBuffer, and a bit of cleanup. Daniel | ||
| 2e2691b5 | 2005-10-21 14:45:16 | prevent output of fragment tags when serializing XHTML. * xmlsave.c: prevent output of fragment tags when serializing XHTML. | ||
| 33b20b70 | 2005-09-12 21:43:20 | release of 2.6.22 updated doc and rebuild. added XML_SAVE_NO_XHTML * NEWS configure.in doc//*: release of 2.6.22 updated doc and rebuild. * xmlsave.c include/libxml/xmlsave.h: added XML_SAVE_NO_XHTML xmlSaveOption * xmlschemas.c: minor cleanups Daniel | ||
| dbd61053 | 2005-09-12 14:03:26 | applied second patch from David Madore to be less intrusive when handling * xmlsave.c: applied second patch from David Madore to be less intrusive when handling scripts and style elements in XHTML1 should fix #316041 * test/xhtml1 result//xhtml1\*: updated the test accordingly Daniel | ||
| 2ce51c06 | 2005-09-12 12:16:35 | add XML_SAVE_NO_EMPTY save option and use option from xmlSaveCtxtPtr * include/libxml/xmlsave.h xmlsave.c: add XML_SAVE_NO_EMPTY save option and use option from xmlSaveCtxtPtr rather than global during output. * xmlsave.c: fix some output formatting for meta element under XHTML. | ||
| 60071aec | 2005-09-12 00:03:43 | fix bug #316034, where xmlElemDump() can crash if given a document pointer * xmlsave.c: fix bug #316034, where xmlElemDump() can crash if given a document pointer instead of an element Daniel | ||
| 07b72007 | 2005-09-03 14:56:36 | check for NULL to prevent crash with meta elements * xmlsave.c: check for NULL to prevent crash with meta elements | ||
| 31f73028 | 2005-08-26 15:33:26 | move handling of meta element for http-equiv in XHTML docs to * xmlsave.c: move handling of meta element for http-equiv in XHTML docs to serialization and no longer modify internal tree. | ||
| 100e1803 | 2005-08-08 14:44:11 | fixed #145092 by adding an xmlSaveOption to omit XML declaration Daniel * xmlsave.c include/libxml/xmlsave.h: fixed #145092 by adding an xmlSaveOption to omit XML declaration Daniel | ||
| 7cd517c2 | 2005-05-20 18:47:22 | applied patch from Mark Vakoc fixing saving of CDATA with NULL content. * xmlsave.c: applied patch from Mark Vakoc fixing saving of CDATA with NULL content. Daniel | ||
| 5d4644ef | 2005-04-01 13:11:58 | 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 | ||
| 64354ea7 | 2005-03-31 15:22:56 | fixed bug reported by Petr Pajas, in the absence of encoding UTF-8 should * xmlsave.c: fixed bug reported by Petr Pajas, in the absence of encoding UTF-8 should really be assumed. This may break if the HTTP headers indicates for example ISO-8859-1 since this then becomes a well formedness error. Daniel |