Log

Author Commit Date CI Message
Nick Wellnhofer aeb69fd3 2022-09-01T02:33:16 Fix overflow check in SAX2.c
Nick Wellnhofer 65dc8a63 2022-09-01T00:13:19 Make xmlNewSAXParserCtx take a const sax handler Also improve documentation.
Nick Wellnhofer ce8f3d11 2022-08-29T23:53:40 Fix libxml_PyFileGet with stdout on macOS macOS returns O_RDWR for standard file descriptors, but fails to write to stdout or stderr when opened with fdopen(dup_fd, "rw").
Nick Wellnhofer b1a09618 2022-08-29T17:21:19 Migrate from PyEval_ to PyObject_ PyEval_ functions are deprecated. Fixes #208.
Nick Wellnhofer ae2b8021 2022-08-29T16:13:50 Cleanup distribution settings in Makefile.am - Remove useless nodist_ prefix - Prefer dist_ prefix over EXTRA_DIST - Remove .in files from EXTRA_DIST
Nick Wellnhofer b0916e0e 2022-08-26T17:57:58 Also clean *.pyc files for Python 2
Nick Wellnhofer aa383e66 2022-08-26T17:37:09 Don't distribute libxml2.spec This is a generated file.
Xi Ruoyao df003c0a 2022-08-26T10:09:13 build: require automake-1.16.3 or later We need https://git.savannah.gnu.org/cgit/automake.git/commit/?id=e21d46f to avoid an error like checking for PYTHON... no configure: error: Package requirements (python-3.1) were not met: No package 'python-3.1' found With python-3.10. Partially fixes #392. Note that there is another issue with python-3.10, like: checking for python... no checking for python2... no checking for python3... no checking for python3.9... no ... configure: error: no suitable Python interpreter found Fixing this one will need to require bumping automake version again, but the automake version containing this fix is not released yet. And, this is rather minor because most environment has "python3" as a symlink to "python3.10" or whatever the latest python3.x installed.
Nick Wellnhofer 47803697 2022-08-26T16:31:55 Work around strange -fsanitize=integer issue With clang 14, __attribute__ ((nosanitize)) stops working with -fsanitize=undefined,integer Using the following works (and should be equivalent) -fsanitize=undefined,unsigned-integer-overflow,implicit-conversion
Nick Wellnhofer 8016c8ed 2022-08-26T15:12:21 Remove set-but-unused variable in xmlXPathScanName Fix clang warning.
Nick Wellnhofer ebc04fec 2022-08-26T15:10:06 Allow Python deprecation warnings for now See #208.
Nick Wellnhofer 4eca70e5 2022-08-26T14:50:21 Update MAINTAINERS.md
Nick Wellnhofer d7a334f2 2022-08-26T14:43:28 Silence -Warray-bounds warning This is a hack, but works for now. Fixes #389.
Nick Wellnhofer b218abce 2022-08-26T02:49:25 Don't create missing.xml when running testapi Side effect of b31e07db. Use a non-existing directory to avoid creating a file.
Nick Wellnhofer 39dfb048 2022-08-26T02:41:15 Don't forget to install xmlversion.h Fixes 7f7961df.
Nick Wellnhofer 1660331b 2022-08-26T02:24:23 Remove xmlErrMemory from symbols This function was never publically declared.
Nick Wellnhofer 0f568c0b 2022-08-26T01: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.
Nick Wellnhofer 48f84ea8 2022-08-25T21:31:08 Remove internal macros from parserInternals.h Replace MOVETO_ENDTAG with code that updates line and column numbers.
Nick Wellnhofer 58fc89e8 2022-08-25T20:57:30 Deprecate internal parser functions
Nick Wellnhofer a308c0cd 2022-08-25T20:18:16 Deprecate old HTML SAX API
Nick Wellnhofer 51035c53 2022-08-25T19:53:04 Generate deprecation warnings for old SAX API
Nick Wellnhofer 7f7961df 2022-08-25T13:47:16 Remove generated files from distribution - libxml2.spec - libxml-2.0.pc - xml2-config - include/libxml/xmlversion.h - python/libxml2.py - python/libxml2-export.c - python/libxml2-py.c - python/libxml2-py.h - python/libxml2class.py - python/libxml2class.txt - python/setup.py
Nick Wellnhofer 2bea68af 2022-08-25T13:50:09 Bump version to 2.11.0 This will be the next release cut from the master branch.
Nick Wellnhofer 34a050cd 2022-08-24T16:35:58 Move some HTML functions to correct header file
Nick Wellnhofer ca3807d9 2022-08-24T15:55:46 Mark more functions setting globals as deprecated
Nick Wellnhofer 74c84a8c 2022-08-24T15:51:28 xmllint: Don't set deprecated globals Setting parser options should be enough.
Nick Wellnhofer e70b0c5e 2022-08-24T15:16:04 Rebuild documentation
Nick Wellnhofer fd85b566 2022-08-24T15:12:24 Mark more parser functions as deprecated No compiler warnings generated yet.
Nick Wellnhofer 88637d42 2022-08-24T15:09:46 Improve cross-references in API docs Also cross-reference keywords followed by a period. This is still a hack but catches quite a few more keywords.
Nick Wellnhofer 6cdaa192 2022-08-24T14:34:04 Rebuild documentation
Nick Wellnhofer b33be8a0 2022-08-24T14:29:50 Switch back to HTML output for API documentation
Nick Wellnhofer 0e49f882 2022-08-24T05:25:37 Mark most SAX1 functions as deprecated No compiler warnings generated yet.
Nick Wellnhofer ce93ee90 2022-08-24T05:24:13 xmllint: Stop calling xmlSAXDefaultVersion This should already be handled by setting XML_PARSE_SAX1.
Nick Wellnhofer 9a82b94a 2022-08-24T04:21:58 Introduce xmlNewSAXParserCtxt and htmlNewSAXParserCtxt Add API functions to create a parser context with a custom SAX handler without having to mess with ctxt->sax manually.
Nick Wellnhofer 0a04db19 2022-08-24T14:06:00 Don't mess with parser options in htmlParseDocument Don't set ctxt->html. This member should already be initialized. Set ctxt->linenumbers in htmlCtxtUseOptions like the XML parser does.
Nick Wellnhofer d45263a2 2022-08-24T14:04:35 Remove useless call to htmlDefaultSAXHandlerInit This function is already called from xmlInitParser.
Nick Wellnhofer 3513d76a 2022-08-24T02:18:50 Improve documentation of globals Document more global variables as deprecated. Some of the variables don't generate deprecation warnings yet, but they shouldn't be used in new code.
Nick Wellnhofer f703ed69 2022-08-24T01:29:49 Fix documentation parser Reset comment right after adding to the index.
Nick Wellnhofer bd6a4272 2022-08-24T00:17:51 Rebuild API documentation
Nick Wellnhofer 4f3eb8a3 2022-08-24T00:15:10 Support comments for global variables in documentation This was never implemented.
Nick Wellnhofer 288c951e 2022-08-24T00:12:59 Fix update call in apibuild.py There are still a few places where try/except is used for branching. This is a bad idea since it can hide errors like this one.
Nick Wellnhofer 92bb889b 2022-08-24T00:03:44 Don't index anything in DOC_DISABLE sections Somewhat misleadingly, the DOC_DISABLE directive only disabled warnings. Now we really stop the documentation generator from indexing. This results in additional warnings for xmlThrDef* functions. This should be fixed by documenting or deprecating them.
Nick Wellnhofer 75b5bc2b 2022-08-23T20:57:49 Deprecate some global variables Most of these should be completely unused.
Nick Wellnhofer 484efeb6 2022-08-23T20:07:39 cmake: Disable version script on macOS Fixes #400
Nick Wellnhofer e519c6e1 2022-08-22T15:16:00 Fix testapi when building --without-sax1 Broken in commit c61e1273.
Nick Wellnhofer 4b184240 2022-08-22T14:11:15 Remove htmlDefaultSAXHandler from non-SAX1 build This matches long-standing behavior of the XML counterpart.
Nick Wellnhofer 80bd34c3 2022-08-22T14:06:37 Don't initialize SAX handler in htmlReadMemory The SAX handler is already initialized when creating the parser context.
Nick Wellnhofer 37cedc0b 2022-08-22T14:04:07 Fix htmlReadMemory mixing up XML and HTML functions Also see fe6890e2.
Nick Wellnhofer 920753c4 2022-08-22T13:46:50 Don't use default SAX handler to report unrelated errors
Nick Wellnhofer 38f04779 2022-08-22T13:33:35 Fix HTML parser with threads and --without-legacy If the legacy functions are disabled, the default "V1" HTML SAX handler isn't initialized in threads other than the main thread. htmlInitParserCtxt would later use the empty V1 SAX handler, resulting in NULL documents. Change htmlInitParserCtxt to initialize the HTML SAX handler by calling xmlSAX2InitHtmlDefaultSAXHandler. This removes the ability to change the default handler but is more in line with the XML parser which initializes the SAX handler by calling xmlSAXVersion, ignoring the V1 default handler. Fixes #399.
Nick Wellnhofer c21e9cd5 2022-08-20T17:02:02 Use xmlStrlen in xmlNewStringInputStream xmlStrlen handles buffers larger than INT_MAX more gracefully.
Nick Wellnhofer 5b2d07a7 2022-08-20T17:00:50 Use xmlStrlen in *CtxtReadDoc xmlStrlen handles buffers larger than INT_MAX more gracefully.
Nick Wellnhofer b1b65417 2022-08-20T15:15:04 Create stream with buffer in xmlNewStringInputStream Create an input stream with a buffer in xmlNewStringInputStream. Otherwise, switching encodings won't work. See #34.
Nick Wellnhofer 4ad71c2d 2022-08-20T16:19:34 Fix xmlCtxtReadDoc with encoding xmlCtxtReadDoc used to create an input stream involving xmlNewStringInputStream. This would create a stream without an input buffer, causing problems with encodings (see #34). After commit aab584dc3, an error was returned even with UTF-8 encodings which happened to work before. Make xmlCtxtReadDoc call xmlCtxtReadMemory which doesn't suffer from these issues. Also fix htmlCtxtReadDoc. Fixes #397.
Nick Wellnhofer d54f829f 2022-08-19T11:28:49 Rebuild documentation
Nick Wellnhofer b071d74b 2022-08-18T22:17:35 Port build_glob.py to Python 3
Nick Wellnhofer b22b6deb 2022-08-18T21:58:07 Port genChRanges.py to Python 3
Nick Wellnhofer 18d79460 2022-08-18T21:03:56 Port doc/examples/index.py to Python 3 - Make sure that examples.xml is generated deterministically - Sort includes by line number
Nick Wellnhofer 5264fa11 2022-08-18T20:17:27 Fix warnings from apibuild.py
Nick Wellnhofer a7af2c99 2022-08-18T20:03:07 Fix order of exports in libxml2-api.xml The values passed to the `uniq` function are dictionary keys and should already be unique. On older Python versions, this would reshuffle the list after it had just been sorted.
Nick Wellnhofer f82b56c6 2022-08-18T19:51:33 Remove libxml2-refs.xml The cross-reference was only used by the old website.
Nick Wellnhofer b60cdf1f 2022-08-18T19:17:37 Remove Makefile rule to build testapi.c This file is under version control and should only be rebuilt on demand.
Nick Wellnhofer 35297983 2022-08-17T14:52:31 Start with documentation for maintainers
Nick Wellnhofer ae383bdb 2022-08-17T13:16:19 Release v2.10.0
Nick Wellnhofer d20df9d8 2022-08-17T12:01:04 Cleanup files generated by test suite Fixes make distcheck.
Nick Wellnhofer 4e494b9c 2022-08-17T12:00:40 Add uninstall target for examples Fixes make distcheck.
Nick Wellnhofer 229fe8f1 2022-08-17T11:41:23 Rebuild documentation
Nick Wellnhofer 24323d31 2022-08-17T11:39:55 Don't autogenerate doc/examples/Makefile.am
Nick Wellnhofer 0fbfb4b5 2022-08-17T11:22:38 Make gentest.py work with Python 2
Nick Wellnhofer a09c8954 2022-08-15T12:19:25 Fix memory leak with invalid XSD xmlSchemaClearElemInfo can add new items to the "matcher" cache, so the cache must be cleared after calling this function, not before. This only seems to affect invalid XSDs. Fixes #390.
Nick Wellnhofer 3c4e4bb7 2022-08-05T16:24:51 Fix build with older pkg-config versions The PKG_CHECK_VAR macro was introduced in pkg-config 0.28. Guard the invocation with m4_ifdef. Fixes #374.
Nick Wellnhofer e986d09c 2022-07-15T14:02:26 Skip incorrectly opened HTML comments Commit 4fd69f3e fixed handling of '<' characters not followed by an ASCII letter. But a '<!' sequence followed by invalid characters should be treated as bogus comment and skipped. Fixes #380.
Nick Wellnhofer 6722d22c 2022-07-15T13:26:41 Reduce indentation in HTMLparser.c No functional change.
Nick Wellnhofer 39745c92 2022-07-19T21:23:44 Improve documentation of tree manipulation API - Discourage use of node constructors without document. - Mention that xmlReconciliateNs is crucial when moving nodes from one document to another.
Nick Wellnhofer 677a4264 2022-07-28T20:21:24 Make XPath depth check work with recursive invocations EXSLT functions like dyn:map or dyn:evaluate invoke xmlXPathRunEval recursively. Don't set depth to zero but keep and restore the original value to avoid stack overflows when abusing these functions.
Nick Wellnhofer a82ea25f 2022-07-28T21:35:17 Also reset nsNr in htmlCtxtReset
Nick Wellnhofer 5930fe01 2022-07-18T20:59:45 Reset nsNr in xmlCtxtReset
Daniel E eab0ce8f 2022-07-13T21:47:37 cmake: Install libxml.m4 on UNIX-like platforms Install libxml.m4 to follow GNU Autotools more closely
Daniel E 88012a38 2022-07-13T21:02:50 cmake: Use symbol versioning on UNIX-like platforms Use symbol versioning to follow GNU Autotools more closely
Sergey Kosukhin c9925454 2022-07-06T17:08:26 Use NAN/INFINITY if available to init XPath NaN/Inf
Nick Wellnhofer ca2c91f1 2022-06-28T19:24:14 Fix memory leak in xmlLoadEntityContent error path Free the input stream if pushing it fails. Found by OSS-Fuzz. https://bugs.chromium.org/p/oss-fuzz/issues/detail?id=43743
Nick Wellnhofer ecba4cbd 2022-06-28T19:22:31 Avoid double-free if malloc fails in inputPush It's the caller's responsibility to free the input stream if this function fails.
Nick Wellnhofer 3e7b4f37 2022-05-20T23: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.
Nick Wellnhofer 823bf161 2022-05-20T22:38:38 Simplify xmlFreeNode
Nick Wellnhofer a17a1f56 2022-05-18T02:17:31 Don't reset nsDef when changing node content nsDef is only used for element nodes.
Nick Wellnhofer 24646525 2022-05-18T02:16:34 Fix unintended fall-through in xmlNodeAddContentLen
Nick Wellnhofer d8f05db8 2022-05-14T22:28:19 Fix Python tests on macOS
David Kilzer 6ef16dee 2022-05-13T14:43:33 Reserve byte for NUL terminator and report errors consistently in xmlBuf and xmlBuffer This is a follow-up to commit 6c283d83. * buf.c: (xmlBufGrowInternal): - Call xmlBufMemoryError() when the buffer size would overflow. - Account for NUL terminator byte when using XML_MAX_TEXT_LENGTH. - Do not include NUL terminator byte when returning length. (xmlBufAdd): - Call xmlBufMemoryError() when the buffer size would overflow. * tree.c: (xmlBufferGrow): - Call xmlTreeErrMemory() when the buffer size would overflow. - Do not include NUL terminator byte when returning length. (xmlBufferResize): - Update error message in xmlTreeErrMemory() to be consistent with other similar messages. (xmlBufferAdd): - Call xmlTreeErrMemory() when the buffer size would overflow. (xmlBufferAddHead): - Add overflow checks similar to those in xmlBufferAdd().
David Kilzer 4ce2abf6 2022-05-29T09:46:00 Fix missing NUL terminators in xmlBuf and xmlBuffer functions * buf.c: (xmlBufAddLen): - Change check for remaining space to account for the NUL terminator. When adding a length exactly equal to the number of unused bytes, a NUL terminator was not written. (xmlBufResize): - Set `buf->use` and NUL terminator when allocating a new buffer. * tree.c: (xmlBufferResize): - Set `buf->use` and NUL terminator when allocating a new buffer. (xmlBufferAddHead): - Set NUL terminator before returning early when shifting contents.
Nick Wellnhofer d70e548f 2022-06-15T17:25:03 Fix xmlCleanupThreads on Windows Fix #ifdef logic: - Also free TLS key in static build. - Always reset 'run_once' state.
Nick Wellnhofer 65f8a620 2022-06-14T18:38:12 Fix reinitialization of library on Windows Reset the 'run_once' state in xmlCleanupThreads, so the global variables can be reinitialized later. While it's generally unsafe to call xmlCleanupParser and continue to use the library afterwards, this fix should avoid an outright crash if you do so on Windows. This should help with applications erroneously calling xmlCleanupParser. See #376.
David Kilzer a6df42e6 2022-05-28T08:08:29 Fix integer overflow in xmlBufferDump() * tree.c: (xmlBufferDump): - Cap the return value to INT_MAX.
David Kilzer c14cac8b 2022-05-25T18:13:07 xmlBufAvail() should return length without including a byte for NUL terminator * buf.c: (xmlBufAvail): - Return the number of bytes available in the buffer, but do not include a byte for the NUL terminator so that it is reserved. * encoding.c: (xmlCharEncFirstLineInput): (xmlCharEncInput): (xmlCharEncOutput): * xmlIO.c: (xmlOutputBufferWriteEscape): - Remove code that subtracts 1 from the return value of xmlBufAvail(). It was implemented inconsistently anyway.
David Kilzer fe9f76eb 2022-05-25T15:58:30 Remove unused xmlBuf functions Remove the following functions: - xmlBufAddHead() - xmlBufErase() - xmlBufInflate() - xmlBufWriteCHAR() - xmlBufWriteChar()
David Kilzer 461ef8ac 2022-05-25T14:19:10 Fix double colon typos in xmlBufferResize() Introduced in commit 6c283d83e.
David Kilzer 4bc3ebf3 2022-03-19T17:17:40 Fix ownership of xmlNodePtr & xmlAttrPtr fields in xmlSetTreeDoc() When changing `doc` on an xmlNodePtr or xmlAttrPtr, certain fields must either be a free-standing string, or they must be owned by `doc->dict`. The code to make this change was simply missing, so the crash happened when an xmlAttrPtr was being torn down after `doc` changed from non-NULL to NULL, but the `name` field was not copied. This is scenario 1 below. The xmlNodePtr->name and xmlNodePtr->content fields are also fixed at the same time. Note that xmlNodePtr->content is never added to the dictionary, so NULL is used instead of `newDict` to force a free-standing copy. This change covers all cases of dictionary changes: 1. Owned by old dictionary -> NULL new dictionary - Create free-standing copy of string. 2. Owned by old dictionary -> Non-NULL new dictionary - Get string from new dictionary pool. 3. Not owned by old dictionary -> Non-NULL new dictionary - No action necessary (already a free-standing string). 4. Not owned by old dictionary -> NULL new dictionary - No action necessary (already a free-standing string). * tree.c: (_copyStringForNewDictIfNeeded): Add. (xmlSetTreeDoc): - Update xmlNodePtr->name, xmlNodePtr->content and xmlAttrPtr->name when changing the document, if needed. Found by OSS-Fuzz Issue 45132.
Nick Wellnhofer 0aa8652e 2022-05-20T14:54:49 Use xmlNewDocText in xmlXIncludeCopyRange Otherwise, the initial node of the copy could be a text node with a NULL document. This results in the NULL document being propagated to copies of other nodes, losing information about the dictionary in which node data is stored, and freeing a dict-allocated string. See discussion in !175.
Nick Wellnhofer 351dbdfe 2022-05-20T14:53:33 Disable network in API tests Avoids hangs when trying to make network connections.
David Kilzer c50196c1 2022-04-10T20:02:47 Fix use-after-free bugs when calling xmlTextReaderClose() before xmlFreeTextReader() on post-validating parser When creating an xmlTextReaderPtr using xmlReaderForMemory(), there are two optional API functions that can be used: - xmlTextReaderClose() may be called prior to calling xmlFreeTextReader() to free parsing resources and close the xmlTextReaderPtr without freeing it. - xmlTextReaderCurrentDoc() may be called to return an xmlDocPtr that's owned by the caller, and must be free using xmlFreeDoc() after calling xmlFreeTextReader(). The use-after-free issues occur when calling xmlTextReaderClose() before xmlFreeTextReader(), with different issues occurring depending on whether xmlTextReaderCurrentDoc() is also called. * xmlreader.c: (xmlFreeTextReader): - Move code to xmlTextReaderClose(), remove duplicate code, and call xmlTextReaderClose() if it hasn't been called yet. (xmlTextReaderClose): - Move call to xmlFreeNode(reader->faketext) from xmlFreeTextReader() to fix a use-after-free bug when calling xmlTextReaderClose() before xmlFreeTextReader(), but not when using xmlTextReaderCurrentDoc(). The bug was introduced in 2002 by commit beb70bd39. In 2009 commit f4653dcd8 fixed the use-after-free that occurred every time xmlFreeTextReader() was called, but not the case where xmlTextReaderClose() was called first. - Move post-parsing validation code from xmlFreeTextReader() to fix a second use-after-free when calling xmlTextReaderClose() before xmlFreeTextReader(). This regressed in v2.9.10 with commit 57a3af56f.
David Kilzer 054e46b0 2022-05-14T08:48:01 Restore behavior of htmlDocContentDumpFormatOutput() Patch by J Pascoe of Apple. * HTMLtree.c: (htmlDocContentDumpFormatOutput): - Prior to commit b79ab6e6d92, xmlDoc.type was set to XML_HTML_DOCUMENT_NODE before dumping the HTML output, then restored before returning.