Log

Author Commit Date CI Message
Nick Wellnhofer 68a6518c 2022-11-15T18:23:33 parser: Rewrite push parser boundary checks Remove inaccurate xmlParseCheckTransition check. Remove non-incremental xmlParseGetLasts check. Add functions that check for several boundary constructs more accurately, keeping track of progress in ctxt->checkIndex. Fixes #439.
Nick Wellnhofer 2059df53 2022-11-14T22:27:58 buf: Deprecate static/immutable buffers
Nick Wellnhofer f30adb54 2022-11-14T21:05:32 uri: Allow port without host Don't set port to -1 when host is missing. Host can be empty according to spec. Fixes #71.
Nick Wellnhofer f00739c1 2022-11-14T00:18:39 parser: Ignore cdata argument in xmlParseCharData It never could be used to parse CDATA sections.
Nick Wellnhofer e4f56a72 2022-11-13T23:42:10 parser: Simplify xmlParseConditionalSections
Nick Wellnhofer 76d6b0d7 2022-11-14T21:02:15 html: Don't escape ASCII chars in href attributes In several cases, href attributes can contain ASCII characters which are illegal in URIs. Escaping them often does more harm than good. Fixes #321.
Nick Wellnhofer 3582b07b 2022-11-13T22:57:32 parser: Fix content parser progress checks This is another attempt at fixing parser progress checks. Instead of relying on in->consumed, which could overflow, change some content parser functions to make guaranteed progress on certain byte sequences.
Nick Wellnhofer f7ad338e 2022-11-13T21:59:23 parser: Fix attribute parser progress checks This is another attempt at fixing parser progress checks. Instead of relying on in->consumed, which could overflow, make the attribute parser functions return a NULL name only if they don't make progress.
Nick Wellnhofer 1ca0dfec 2022-11-14T22:00:50 reader: Switch to xmlParserInputBufferCreateMem This is less efficient but can't result in input buffer overreads. Fixes #326.
Nick Wellnhofer 4955e0c9 2022-11-14T20:16:22 io: Don't shrink memory input buffers
Nick Wellnhofer f61b8a62 2022-11-13T21:47:03 parser: Fix DTD parser progress checks This is another attempt at fixing parser progress checks. Instead of relying on in->consumed, which could overflow, change some DTD parser functions to make guaranteed progress on certain byte sequences.
Nick Wellnhofer 249cee4b 2022-11-13T20:19:13 io: Fix a few integer overflows in I/O statistics There are still many places where arithmetic on "consumed" stats isn't checked for overflow, affecting platforms with a 32-bit long type.
Nick Wellnhofer 117bab22 2022-11-14T20:15:59 parser: Don't call xmlSHRINK from push parser xmlSHRINK also calls xmlParserInputGrow which isn't needed in the push parser.
Nick Wellnhofer 6b570619 2022-11-13T19:44:00 io: Rearrange code in xmlSwitchInputEncodingInt No functional change.
Nick Wellnhofer 1ef4938f 2022-11-13T17:55:28 io: Rework xmlParserInputBufferGrow with encodings Read data directly into the "raw" buffer when converting encodings. Make sure not to grow memory input buffers.
Nick Wellnhofer 46cd7d22 2022-11-13T16:30:46 io: Remove xmlInputReadCallbackNop In some cases, for example when using encoders, the read callback was set to NULL, in other cases it was set to xmlInputReadCallbackNop. xmlGROW only tested for xmlInputReadCallbackNop, resulting in errors when parsing large encoded content from memory. Always use a NULL callback for memory buffers to avoid ambiguities. Fixes #262.
Nick Wellnhofer 9feafbc5 2022-11-13T16:56:10 io: Check for memory buffer early in xmlParserInputGrow
Nick Wellnhofer 22d879bf 2022-11-13T15:08:44 io: Fix "buffer full" error with certain buffer sizes Remove a useless check in xmlParserInputBufferGrow that could be triggered after changing xmlBufAvail in c14cac8b. Fixes #438.
Nick Wellnhofer 0d1765fd 2022-11-13T15:20:13 doc: Mention new location of XML catalog as breaking change
Nick Wellnhofer a2493721 2022-11-04T15:06:25 doc: Mention potentially breaking changes in NEWS
Nick Wellnhofer b693905f 2022-11-04T14:50:39 doc: Remove xmlDllMain from documentation and version script This is a Windows-only symbol.
Nick Wellnhofer d48faf1a 2022-11-04T14:30:50 doc: Mention ${sysconfdir} in man pages Fixes #395.
Nick Wellnhofer 3ab57bf4 2022-11-04T14:25:23 doc: Document xmlcatalog --convert Fixes #417.
Nick Wellnhofer ae7096a1 2022-11-04T14:21:53 doc: Document xmllint --nodict and --pedantic Fixes #418.
Nick Wellnhofer 736487df 2022-11-04T14:17:01 doc: Fix indentation in source XML files
Nick Wellnhofer a70f7d47 2022-11-04T14:03:31 parser: Fix error message in xmlParseCommentComplex Fixes #421.
Markus Jörg 1fa4d14f 2022-11-04T12:34:39 Bypass proxy in nanoHTTP for hosts in "no_proxy"
Nick Wellnhofer b4592709 2022-11-02T16:22:54 malloc-fail: Fix memory leak in xmlStringGetNodeList Also make sure to return NULL on error instead of a partial node list. Found with libFuzzer, see #344.
Nick Wellnhofer 5a19e216 2022-11-02T16:13:27 malloc-fail: Fix use-after-free in xmlXIncludeAddNode Found with libFuzzer, see #344.
Nick Wellnhofer afc7e3a7 2022-11-02T16:11:00 malloc-fail: Fix memory leak in xmlParseReference Found with libFuzzer, see #344.
Nick Wellnhofer 7ceaee94 2022-11-02T16:05:05 malloc-fail: Fix memory leak in xmlSAX2ExternalSubset Found with libFuzzer, see #344.
Nick Wellnhofer e129c1d1 2022-11-02T16:02:39 malloc-fail: Fix infinite loop in xmlSkipBlankChars Found with libFuzzer, see #344.
Nick Wellnhofer dd50cfeb 2022-11-02T15:58:31 malloc-fail: Fix memory leak in xmlNewDocNodeEatName Found with libFuzzer, see #344.
Nick Wellnhofer fa361de0 2022-11-02T15:53:52 malloc-fail: Fix memory leak in xmlNewPropInternal Also fixes a memory leak if called with a non-element node. Found with libFuzzer, see #344.
Nick Wellnhofer 865e142c 2022-11-02T15:46:11 malloc-fail: Fix memory leak in xmlCreatePushParserCtxt Found with libFuzzer, see #344.
Nick Wellnhofer a22bd982 2022-11-02T15:44:42 malloc-fail: Fix memory leak in xmlStaticCopyNodeList Found with libFuzzer, see #344.
Nick Wellnhofer abb5a93f 2022-11-02T10:53:24 schemas: Fix infinite loop in xmlSchemaCheckElemSubstGroup Types like xmlSchemaTypeAnyTypeDef have a base type pointing to itself, resulting in an infinite loop. Fixes #430.
Nick Wellnhofer 9aba613b 2022-10-31T17:09:54 fuzz: Add new XInclude test directory to corpus
Nick Wellnhofer b456e3bb 2022-10-30T20:28:20 xinclude: Always allow XPtr expressions in external documents
Nick Wellnhofer f14529ba 2022-10-30T12:32:14 xinclude: Fix more memory leaks in xmlXIncludeLoadDoc
Nick Wellnhofer eef0a739 2022-10-30T12:21:20 xinclude: Implement "streaming" mode When using xmlreader, XPointer expressions in XIncludes simply cannot work. Expressions can reference nodes which weren't parsed yet or which were already deleted. After fixing nested XIncludes, we reference includes which were parsed previously. When streaming, these nodes could have been deleted, leading to use-after-free errors. Disallow XPointer expressions and truncate the include table in streaming mode.
Nick Wellnhofer 7e078cc1 2022-10-30T12:03:51 xinclude: Clean up xmlXIncludeDoProcess Only scan new includes in the second pass. Always reset the "replace" flag. This only matters if xmlXIncludeDoProcess is called multiple times on the same document which currently only happens when called from xmlreader.
Nick Wellnhofer 075cee9e 2022-10-29T15:38:16 xinclude: Fix memory leak when fuzzing This only affects the fuzzing build mode.
Nick Wellnhofer b59ff587 2022-10-28T20:08:02 xinclude: Fix memory leak in xmlXIncludeLoadDoc Regressed in a recent commit.
Nick Wellnhofer 66f781cf 2022-10-24T14:56:26 gitlab-ci: Upgrade image to Ubuntu 22.10, reenable MSan MSan and 64-bit stat was broken on Ubuntu 22.04 (glibc >= 2.33, LLVM <= 14), see https://github.com/llvm/llvm-project/commit/1f82d0f7
Nick Wellnhofer 80e43d1b 2022-10-24T01:08:25 gitlab-ci: Reenable LeakSanitizer Let's hope it works on the asan runners.
Nick Wellnhofer d767c6be 2022-10-23T23:26:31 gitlab-ci: Fix llvm-symbolizer Newer versions of llvm-symbolizer require libxml2 themselves. Running a test program with LD_LIBRARY_PATH set to .libs makes llvm-symbolizer pick up the tested development version of libxml2 which breaks completely if the build is instrumented with ASan. Add a wrapper script that invokes llvm-symbolizer with an empty LD_LIBRARY_PATH.
Nick Wellnhofer 128c0261 2022-10-25T19:23:07 warnings: Fix -Wstrict-prototypes warning
Nick Wellnhofer b6f1298a 2022-10-24T20:47:10 warnings: Remove set-but-unused variables Fixes compiler warnings with clang 15.
Nick Wellnhofer bffc67d1 2022-10-24T20:24:17 threads: Remove check for pthread_equal GCC 12 fixed -Waddress warnings for inline functions, resulting in warnings when comparing pthread_equal with NULL. Simply remove the check and assume that pthread_equal is available if all the other functions are. This code is only enabled on Linux anyway.
Nick Wellnhofer 20e2fb4c 2022-10-23T17:52:29 xinclude: Avoid creation of subcontexts Don't create subcontext in xmlXIncludeRecurseDoc. Save and restore 'doc' and 'incTab' instead. Make xmlXIncludeLoadFallback call xmlXIncludeCopyNode which seems safer than xmlXIncludeDoProcess since the latter may modify the document. This should also be more performant since we need to copy the whole fallback subtree anyway. Also make sure to avoid replacements in fallback elements in xmlXIncludeDoProcess.
Nick Wellnhofer 010b682f 2022-10-23T16:02:48 xinclude: Rework XInclude cache Use a single cache stored in the "root" context, avoiding cache misses in some scenarios. Separate the cache from the "include" table. Rework recursion check.
Nick Wellnhofer 3b68aa47 2022-10-23T16:54:22 xinclude: Remove unused 'doc' argument from xmlXIncludeDoProcess
Nick Wellnhofer 0b09f132 2022-10-23T14:59:31 xinclude: Remove unused member 'url' from xmlXIncludeCtxt
Nick Wellnhofer 966f5ebd 2022-10-23T14:14:39 xinclude: Remove inefficient refcounting scheme xinclude.c used to implement a refcounting mechanism for documents which could result in documents being freed too early and reloaded. We really should keep parsed and processed documents around for as long as possible to avoid reprocessing.
Nick Wellnhofer fe0194d5 2022-10-23T13:57:33 xinlucde: Pass xmlXIncludeRefPtrs directly Stop passing indices into the include table.
Nick Wellnhofer 0fc5be0a 2022-10-23T13:55:29 xinclude: Remove dead code in xmlXIncludeLoadDoc The include table was already scanned for entries with a matching URI a couple of lines before.
Nick Wellnhofer 2fc8d123 2022-10-22T19:08:43 xinclude: Make xmlXIncludeCopyNode non-recursive Avoid call stack overflows. Also switch to xmlStaticCopyNode which avoids duplicate namespace definitions.
Nick Wellnhofer bc32c386 2022-10-22T17:48:25 xinclude: Don't pass documents to xmlXIncludeCopyNode Extract the root element directly in xmlXIncludeCopyXPointer.
Nick Wellnhofer 46e4cfb6 2022-10-22T19:20:20 xinclude: Remove unused source and target arguments source is unused, target is always ctxt->doc.
Nick Wellnhofer d2ed1e4f 2022-10-22T16:50:18 xinclude: Limit recursion depth This avoids call stack overflows.
Nick Wellnhofer bc267cb9 2022-10-22T02:19:22 xinclude: Expand includes in xmlXIncludeCopyNode This should make nested includes work reliably. Fixes #424.
Nick Wellnhofer 5e4b751f 2022-10-22T02:17:39 xinclude: Make xmlXIncludeCopyNode return a node list Convert callers of xmlXIncludeCopyNode to handle node lists.
Nick Wellnhofer 64eaf4d4 2022-10-21T16:05:29 xinclude: Make xmlXIncludeCopyNode iterate all descendants
Nick Wellnhofer 5f664ab2 2022-10-21T16:17:48 xinclude: Rework xmlXIncludePreProcessNode Rename xmlXIncludePreProcessNode to xmlXIncludeExpandNode. Search the include table for an already existing entry. Also load the included items in xmlXIncludeExpandNode and remove the second phase in xmlXIncludeDoProcess.
Nick Wellnhofer 4d7524af 2022-10-21T16:46:38 xinclude: Ignore XML_XINCLUDE_START in xmlXIncludeCopyXPointer The XPath engine shouldn't return such nodes anyway.
Nick Wellnhofer ea7c9fb5 2022-10-22T16:48:58 xinclude: Don't create result doc for test with errors
Nick Wellnhofer 34496f26 2022-10-22T16:09:21 xinclude: Test for inclusion loops
Nick Wellnhofer bad30e2b 2022-10-21T17:27:23 xinclude: Copy included docs with xmlDocCopyNode All includes should already be expanded after calling xmlXIncludeRecurseDoc, so there's no need to invoke the more costly xmlXIncludeCopyNodeList. Now xmlXIncludeCopyNode is only used to copy XPointer fragments.
Nick Wellnhofer c99cde3f 2022-10-22T16:59:35 xinclude: Also test error messages The reader interface with XIncludes is somewhat broken and can generate different error messages. Start to move tests which are sketchy with reader to a separate directory.
Nick Wellnhofer 938105b5 2022-10-21T15:56:12 Revert "xinclude: Fix regression with nested includes" This reverts commit 7f04e297318b1b908cec20711f74f75625afed7f which caused memory errors. See #424.
Nick Wellnhofer e85f9b98 2022-10-19T02:47:30 xmllint: Improve handling of empty XPath node sets Don't return an error if the result is an empty node set. Suppress the "XPath set is empty" message in quiet mode. Fixes #180.
Nick Wellnhofer 530938b4 2022-10-18T18:56:56 cmake: Build static library with -DLIBXML_STATIC Fix scope of target_compile_definitions command. Fixes #425.
Nick Wellnhofer 7f04e297 2022-10-18T18:40:00 xinclude: Fix regression with nested includes This reverts commits 74dcc10b and 87d20b55. Fixes #424.
Nick Wellnhofer 644a89e0 2022-08-31T22:11:25 [CVE-2022-40304] Fix dict corruption caused by entity reference cycles When an entity reference cycle is detected, the entity content is cleared by setting its first byte to zero. But the entity content might be allocated from a dict. In this case, the dict entry becomes corrupted leading to all kinds of logic errors, including memory errors like double-frees. Stop storing entity content, orig, ExternalID and SystemID in a dict. These values are unlikely to occur multiple times in a document, so they shouldn't have been stored in a dict in the first place. Thanks to Ned Williamson and Nathan Wachholz working with Google Project Zero for the report!
Nick Wellnhofer ffaec758 2022-08-25T17:43:08 Fix integer overflows with XML_PARSE_HUGE Also impose size limits when XML_PARSE_HUGE is set. Limit size of names to XML_MAX_TEXT_LENGTH (10 million bytes) and other content to XML_MAX_HUGE_LENGTH (1 billion bytes). Move some the length checks to the end of the respective loop to make them strict. xmlParseEntityValue didn't have a length limitation at all. But without XML_PARSE_HUGE, this should eventually trigger an error in xmlGROW. Thanks to Maddie Stone working with Google Project Zero for the report!
Nick Wellnhofer 1a2d8ddc 2022-10-11T13:02:47 parser: Fix potential memory leak in xmlParseAttValueInternal Fix memory leak in case xmlParseAttValueInternal is called with a NULL `len` a non-NULL `alloc` argument. This static function is never called with such arguments internally, but the misleading code should be fixed nevertheless. Fixes #422.
Nick Wellnhofer 5bfaf230 2022-10-11T13:00:33 win32: Fix build with VS2013 Should fix #420.
Nick Wellnhofer e2bae1bc 2022-09-20T14:34:20 autotools: Don't use version script on Windows A feature test would be better, but blacklisting Windows platforms seems good enough for now.
Nick Wellnhofer 796c830a 2022-09-20T14:30:19 cmake: Set SOVERSION Fixes #410.
Nick Wellnhofer 1d4f5d24 2022-09-13T16:40:31 schemas: Fix null-pointer-deref in xmlSchemaCheckCOSSTDerivedOK Found by OSS-Fuzz.
Nick Wellnhofer f2392dc4 2022-09-09T13:51:58 gitlab-ci: Allow cast-align warnings from clang
Nick Wellnhofer a9669679 2022-09-09T01:44:00 error: Don't use initGenericErrorDefaultFunc The code in xmlInitParser did only set the error handler if it was NULL which should never happen.
Nick Wellnhofer 27c8ba60 2022-09-07T22:34:42 xpath: Lower XPath recursion limit on Windows
Nick Wellnhofer f597eff8 2022-09-07T18:18:06 autotools: Fix winsock detection Hardcode the required library on MinGW because winsock uses non-standard calling conventions on 32-bit Windows which makes AC_SEARCH_LIBS fail. Should fix #406.
Nick Wellnhofer 16d3e8b2 2022-09-07T18:10:03 autotools: Only add network libraries if HTTP/FTP enabled
Nick Wellnhofer ae98a5b4 2022-09-07T12:10:39 gitlab-ci: Fix tar invocation
Nick Wellnhofer c52dd494 2022-09-06T23:27:01 gitlab-ci: Move MSVC test to separate script
Nick Wellnhofer ea78427d 2022-09-06T22:46:07 gitlab-ci: Fix SUFFIX, remove MINGW_PATH
Nick Wellnhofer e4bdbf3d 2022-09-06T21:29:24 gitlab-ci: Consolidate CMake test scripts
Nick Wellnhofer 861466bf 2022-09-06T20:32:08 gitlab-ci: Only install MinGW autotools if needed
Nick Wellnhofer 5ff3baf0 2022-09-06T17:33:38 python: Create .pyd on Windows
Nick Wellnhofer e86ede09 2022-09-06T18:24:25 gitlab-ci: Only install cmake MinGW package if needed On MinGW, cmake requires curl which requires nghttp2 which requires libxml2. But having a system libxml2 interferes with the Python tests for now. Ultimately, we should use Python's os.add_dll_directory() on Windows. I'm not sure why the current solution using PATH even works.
Nick Wellnhofer 7ab3228f 2022-09-06T18:32:55 gitlab-ci: Install 7-Zip using the .msi So we don't need cmake to extract a file.
Nick Wellnhofer fec85df1 2022-09-06T18:50:23 xmllint: Document --quiet option
Nick Wellnhofer ea8f7c92 2022-09-06T00:47:00 autotools: Disable parallel Python build Makefile rules with multiple output files don't work reliably with parallel builds. There are several ways to fix this issue with GNU Make, but they aren't portable. I'd be really interested in a totally reliable, cross-platform solution to this problem. .NOTPARALLEL is also understood by BSD make, at least.
Nick Wellnhofer 9d19c169 2022-09-06T00:21:28 python: Don't output missing generators during build
Nick Wellnhofer a41878bd 2022-09-05T23:16:23 build: Remove check for broken ss_family This only seemed to affect ancient AIX systems.
Nick Wellnhofer c63b2692 2022-09-05T22:50:45 gitlab-ci: Disable MSan for now MSan seems broken on Ubuntu 22.04.
Nick Wellnhofer ad338459 2022-09-05T21:16:20 autotools: Fix bug with multiline arguments Should fix #404.