Log

Author Commit Date CI Message
Nick Wellnhofer 70dc8ca0 2025-06-27T18:54:18 xpath: Add extra info to some error messages Fixes #660.
Daniel P. Berrangé ac5fcb0e 2025-06-25T15:24:24 relaxng: ensure thread safe global initialization Relying on a plain integer flag, with no synchronization primitives does not give thread-safe initialization. All reads & writes of the xmlSchemaTypesInitialized flag need to be protected by a mutex to ensure suitable memory barriers & thus correct ordering wrt any speculative execution. A separate internal initializer tied to xmlParserInit is used to create the mutex used for synchronization, similarly to how catalog.c works. Signed-off-by: Daniel P. Berrangé <berrange@redhat.com>
Daniel P. Berrangé 80798c40 2025-06-25T15:24:24 xmlschemastypes: ensure thread safe global initialization Relying on a plain integer flag, with no synchronization primitives does not give thread-safe initialization. All reads & writes of the xmlSchemaTypesInitialized flag need to be protected by a mutex to ensure suitable memory barriers & thus correct ordering wrt any speculative execution. A separate internal initializer tied to xmlParserInit is used to create the mutex used for synchronization, similarly to how catalog.c works. Signed-off-by: Daniel P. Berrangé <berrange@redhat.com>
Nick Wellnhofer 63f98ee8 2025-06-25T14:27:37 tests: Skip functions taking va_lists in testapi.c See !325.
Nick Wellnhofer d4355722 2025-06-25T13:45:32 xmllint: Print document even in case of XInclude errors Keep printing the document while still reporting XInclude errors to match the old behavior.
Nick Wellnhofer 413cdfb3 2025-06-25T12:37:37 html: Fix push parsing of doctype decls Don't set state to "content" as we might still be in "misc" or "prolog".
Nick Wellnhofer ad0f5d27 2025-06-24T13:02:13 tree: Fix xmlGetNodePath - Fix quadratic behavior - Don't truncate names Fixes #715.
Nick Wellnhofer 22246f21 2025-06-23T22:49:28 schemas: Fix compilation with pre-C99 MSVC Regressed with f307237e. Fixes #944.
Nick Wellnhofer 7cfa3a26 2025-06-22T22:52:47 reader: Remove unused member xinclude_name
Nick Wellnhofer 6c5b5552 2025-06-22T22:49:58 debug: Remove obsolete handling of special case The "nbktext" code was removed.
Nick Wellnhofer 24628f25 2025-06-22T22:18:36 valid: Don't store attribute defaults in dictionary In general, we should only use dicts for names and not values.
Nick Wellnhofer 600742f0 2025-06-22T20:18:40 valid: Unconst local variable in xmlValidateElement
Nick Wellnhofer 7c913850 2025-06-22T20:12:48 parser: Remove unnecessary dict checks when freeing strings The following strings are never allocated from a dict: - xmlParserCtxt.version - xmlParserCtxt.encoding - xmlParserCtxt.extSubURI - xmlParserCtxt.extSubSystem - xmlDoc.version - xmlDoc.encoding - xmlDoc.URL - xmlDTD.ExternalID - xmlDTD.SystemID - xmlID.value Also make the struct members point to non-const chars to avoid casts when freeing.
Nick Wellnhofer 607708b3 2025-06-22T19:18:20 valid: Don't store ID values in document's dictionary ID values are unique. There's some potential for them to be reused as references, but storing them in the dictionary can make the dictionary grow in proportion to the document. Users like lxml replace the `ids` hash table to avoid this. It seems like a good idea to stop using the dictionary for ID values.
Nick Wellnhofer ea91a507 2025-06-22T16:45:49 doc: Generate documentation with Doxygen 1.14 The 1.14.0 release fixes a serious bug with autolinks. Note that the downstream tests now run on Ubuntu with libxml2 and libxslt built on Arch. This seems to work but could break at a later point. Fixes #929.
Nick Wellnhofer 3652fc28 2025-06-22T17:09:42 doc: Fix installation with newer Doxygen Newer versions don't generate PNG files anymore. Simply use *.* as wildcard.
Nick Wellnhofer 404aedbd 2025-06-22T15:46:09 doc: Improve xmllint documentation
Michael Mann dd2b4091 2025-06-18T13:55:37 xmllint: Add --strict-namespace option Use xmlCtxtGetStatus() after parsing. If status indicates a namespace error while the --strict-namespace option is enabled, xmllint will exit with XMLLINT_ERR_RDFILE error Fixes #698
Michael Mann bf26cf9d 2025-06-20T21:24:44 xmllint: Replace boolean application options with single flag member Take all of the boolean application options and create a bitmask for each of them. Then use just a single unsigned member to keep track off all of them (regardless of precompile directives)
Michael Mann be812e1e 2025-06-20T19:34:12 xmllint: Rename options -> parseOptions Make it more obvious the options are related to XML parsing
Nick Wellnhofer e7802738 2025-06-22T14:39:28 parser: Don't load external content if only XML_SKIP_IDS is set At some point, the `loadsubset` member was augmented to also control handling of ID attributes in addition to loading of external DTDs. These two features are unrelated and shouldn't have been mixed. This mistake was probably inspired by the misnamed XML_DETECT_IDS flag. As a side effect, setting XML_SKIP_IDS always enabled loading of external DTDs and parameter entities. This change makes it possible to ignore IDs without loading external content. This is a deliberate API change that improves security and is unlikely to affect users. This also makes sure that the new XML_PARSE_SKIP_IDS option doesn't enable unsafe behavior.
Nick Wellnhofer b424bae7 2025-06-22T13:46:16 html: Fix pull-parsing of initial comments and doctype decls - Parse more bogus comments and multiple doctype declarations before switching to content. - Grow buffer after parsing comment.
Nick Wellnhofer 1c96d5ef 2025-06-21T15:08:07 parser: Add comment in xmlStopParser
Nick Wellnhofer 7e381842 2025-06-18T16:24:44 include: s/char const/const char/
Nick Wellnhofer 19139061 2025-06-18T16:20:46 include: Define XMLPUBVAR directly Using an intermediate macro confuses newer Doxygen versions for some reason.
Nick Wellnhofer a4d25b3d 2025-06-18T16:00:57 doc: Small fixes
Michael Mann cf4f9672 2025-06-21T11:16:39 Add XML_PARSE_SKIP_IDS to replace XML_SKIP_IDS Mark loadset member as deprecated Fixes #873
Nick Wellnhofer 1dcd3df2 2025-06-20T23:46:46 parser: Fix xmlCtxtIsStopped Make xmlCtxtIsStopped check for fatal errors as well. This makes it easier to migrate away from disableSAX.
Nick Wellnhofer 9c6eebac 2025-06-20T22:22:03 xmllint: Fix --xinclude --path Use resource loader for XInclude. Regressed with f96dca9c.
Nick Wellnhofer 2963a0f1 2025-06-20T21:41:24 tree: Undeprecate some members used by libxslt
Markus Rickert 477f9c6b 2025-06-18T13:48:55 Fix CMake iconv handling after change to private dependency
Nick Wellnhofer a3992815 2025-06-12T13:51:37 parser: Fix buffer overflow when parsing PublicIds Regressed with 8231c0366 and 30665ae4.
Nick Wellnhofer 30665ae4 2025-06-11T18:09:41 parser: Fix parsing of PublicIds and VersionNums Regressed in 8231c0366. Fixes #940.
Omar Siam 852b070f 2025-06-10T18:47:59 Change comment style
Omar Siam bb7169b5 2025-06-10T18:34:44 Fix relaxng is parsed to an infinite attrs->next loop Test data for the bug.
Nick Wellnhofer f428bdd1 2025-06-08T16:43:38 xmllint: Make output options depend on LIBXML_OUTPUT_ENABLED
Nick Wellnhofer 3e47ceeb 2025-06-08T14:57:56 xmllint: Warn about options with no effect
Nick Wellnhofer 2ffb8c96 2025-06-08T14:58:29 doc: Improve xmllint documentation Group more options. Clarify effect of some parser options. Mention streaming validation with `--sax`. Remove references to libxml(3).
Nick Wellnhofer 6b50d8c8 2025-06-08T13:05:22 html: Add missing call to grow parser in htmlParseComment Otherwise, long chains of short comments could exhaust the input buffer when pull parsing.
Nick Wellnhofer 70335c41 2025-06-06T03:29:57 html: Don't stop on unsupported encoding Continue to parse unlike in the XML case.
Nick Wellnhofer 416da89d 2025-06-04T20:49:16 html: Make htmlCtxtReset call xmlCtxtReset The two implementations shouldn't diverge.
Nick Wellnhofer fa81e849 2025-06-04T20:42:39 xmllint: Fix --memory --repeat Always reset parser context. Should fix #937.
Nick Wellnhofer 220c813e 2025-06-03T23:33:02 globals: Fix documentation of xmlThrDef* functions
Nick Wellnhofer 7e08d93c 2025-06-03T23:32:41 doc: Improve documentation of tree data types
Nick Wellnhofer 86cf217d 2025-06-03T19:35:03 build: Disable Schematron support by default
Nick Wellnhofer 8da19f23 2025-06-03T16:36:40 doc: Add more warnings to xmlCleanupParser
Alex Richardson 7e4247b2 2025-06-05T21:28:31 parser: use XML_INT_TO_PTR when storing integers as pointers This fixes warnings when using a CHERI-aware toolchain.
Nick Wellnhofer c6206c93 2025-06-05T21:06:11 html: Ignore ASCII-incompatible encoding in meta tag After successfully parsing an ASCII-encoded meta tag, switching to an encoding that isn't ASCII-compatible cannot work.
Nick Wellnhofer 2b6b3945 2025-06-03T16:12:56 Revert "SAX1: Align handling of default attributes with SAX2" This reverts commit db65b2fc51ef0d6e4d2e9dc65ba12fe948da49f3. This didn't check for duplicate default attributes.
Nick Wellnhofer 30375877 2025-06-03T15:50:54 parser: Fix custom SAX parsers without cdataBlock handler Use characters handler if cdataBlock handler is NULL. Regressed with 57e4bbd8. Should fix #934.
Nick Wellnhofer 5e7c72cd 2025-06-03T00:59:10 doc: Misc fixes
Nick Wellnhofer 5f8e537d 2025-06-03T00:46:40 doc: Misc fixes to xpointer
Nick Wellnhofer 1fc66d26 2025-06-03T00:33:27 xmllint: Don't check for removed features
Nick Wellnhofer 479f26f9 2025-06-03T00:28:16 regexp: Remove unfinished reimplementation This was never enabled.
Nick Wellnhofer 3d71ab4f 2025-06-03T00:17:03 doc: Small fixes
Nick Wellnhofer 0ab5d7c5 2025-06-03T00:13:26 entities: Deprecate internal DTD-related functions
Nick Wellnhofer 347c2b2e 2025-06-02T23:26:19 valid: Deprecate a few functions and `xmllint --insert`
Nick Wellnhofer f6eec6f4 2025-06-02T22:45:19 globals: Remove lineNumbersDefaultValue from globals struct
Nick Wellnhofer ac6ae391 2025-06-02T14:33:15 valid: Readd more argument checks in xmlAddElementDecl Fix crashes with API fuzzer.
Nick Wellnhofer 0f8543e1 2025-06-02T14:19:01 parser: Fix error reporting in xmlSkipBlankCharsPEBalanced Short-lived regression.
Nick Wellnhofer 6a6a46f0 2025-05-28T16:02:41 doc: Fix autolink errors Fix links, remove links to internal functions.
Nick Wellnhofer 7bd8d1d9 2025-05-28T15:53:38 doc: Prefix autolinks with '#' Use `#func` instead of `func()` to ignore parameters and make all autolinks work.
Nick Wellnhofer 6e33d136 2025-05-28T14:57:37 error: Fix initGenericErrorDefaultFunc compatibility macro again Now it really should work as before.
Nick Wellnhofer 8baa5de1 2025-05-27T17:51:50 parser: Avoid integer overflow in xmlParseCharDataInternal `nbchar` could overflow with larger than 2GB memory buffers which some new APIs allow. This shouldn't affect memory safety. Limit maximum amount of bytes passed to character callback to XML_MAX_ITEMS (1e9).
Nick Wellnhofer 35d04a08 2025-05-27T17:05:05 README: Set expectations straight Fixes #913.
Nick Wellnhofer ad346c9a 2025-05-27T12:53:17 tree: Fix integer overflow in xmlBuildQName This issue affects memory safety and might receive a CVE ID later. Fixes #926.
Nick Wellnhofer 77c583e0 2025-05-27T12:19:25 valid: Readd argument check in xmlAddElementDecl Fix crashes with API fuzzer.
Nick Wellnhofer 78454e30 2025-05-25T16:53:41 io: Remove xmlInputDefaultOpen Not necessary after removal of HTTP client.
Nick Wellnhofer b79cf474 2025-05-26T15:34:48 globals: Fix memory leak on Windows DLL unload Thread-local memory must be freed for the main thread as well after 4f08a1a2. Fixes #925.
Nick Wellnhofer ab06bfa1 2025-05-26T15:03:07 parser: Fix error return in xmlParseElementContentDecl Avoid internal error later in xmlValidBuildAContentModel after 2a60ca06c. Also avoids some unnecessary error messages.
Nick Wellnhofer 30cf6d09 2025-05-26T01:13:24 parser: Add XML_INPUT_USE_SYS_CATALOG Also clean up catalog resolution and add error handling using the global error. Don't try to look up the resolved URI a second time. Add some comments. Fix documentation.
Nick Wellnhofer 34bafa14 2025-05-25T20:56:40 parser: Use parser context as default in resource loader This allows to access the original context for example when using modules like XInclude or schemas.
Nick Wellnhofer 997830a3 2025-05-16T22:07:39 tests: Always use xmlMalloc/xmlFree
Nick Wellnhofer c136118d 2025-05-25T13:59:50 README: Mention CMake single/multi-config
Nick Wellnhofer 4dc44c83 2025-05-21T20:21:32 parser: Rework entity boundary check for element content Only use depth of input stack. This makes the input ID unused internally.
Nick Wellnhofer 74ea6b48 2025-05-21T17:44:27 parser: Start using input depth for entity boundary check Now that we make sure that PEs starting markup won't be popped implicitly, it's enough to check that no new entities are on the stack when checking boundaries.
Nick Wellnhofer 6f8ac953 2025-05-20T23:17:55 valid: Don't use element namespace for attributes This makes no sense. Unprefixed attributes never have a namespace.
Nick Wellnhofer 5ec83f77 2025-05-20T03:21:27 valid: Remove duplicate #FIXED check for namespaces Unlike the comment indicates, this is already checked.
Nick Wellnhofer 7c10fff2 2025-05-20T22:48:25 valid: Don't validate twice in xmlAddAttributeDecl This should only be done in xmlValidateAttributeDecl.
Nick Wellnhofer db65b2fc 2025-05-20T22:41:08 SAX1: Align handling of default attributes with SAX2 The SAX1 parser is legacy code, but it seems more maintainable to align it with SAX2.
Nick Wellnhofer e4cbc295 2025-05-20T21:57:01 parser: Check attribute normalization standalone constraint To fully implement "VC: Standalone Document Declaration", we have to check for normalization changes caused by non-CDATA attribute types declared externally. Fixes #119.
Nick Wellnhofer 682195c8 2025-05-20T22:00:57 parser: Fix "Proper Declaration/PE Nesting" validity constraint Now that we handle "WFC: PE Between Declarations" correctly, we can turn "Proper Declaration/PE Nesting" from a WFC into VC as specified. Fixes #118.
Nick Wellnhofer 74ff6c00 2025-05-20T22:00:29 error: Fix line number in entities Allow line numbers from more domains, see code above.
Nick Wellnhofer 2f3655c9 2025-05-20T19:40:06 parser: Pop PEs that start markup declarations explicitly We currently only handle "Validity constraint: Proper Declaration/PE Nesting", but we must detect "Well-formedness constraint: PE Between Declarations" separately: > The replacement text of a parameter entity reference in a DeclSep must > match the production extSubsetDecl. PEs in DeclSeps are PEs that start with a full markup declaration (or another PE). These are handled in xmParse{Internal|External}Subset. We set a flag on these PEs and don't close them implicitly in xmlSkipBlankCharsPE. This will make unterminated declarations in such PEs cause a parser error. The PEs are closed explicitly in xmParse{Internal|External}Subset, the only location where they are allowed to end.
Nick Wellnhofer 2a60ca06 2025-05-20T16:50:32 valid: Don't check enum values Rely on the parser to pass valid arguments.
Nick Wellnhofer 4aa7192f 2025-05-21T16:32:17 tests: Add dtor for xmlElementContent in testapi.c
Nick Wellnhofer fc1cabc8 2025-05-25T14:03:50 valid: Also raise duplicate ID error without validation support Whether an error is raised should not depend on config options.
Nick Wellnhofer dd1961e0 2025-05-20T16:37:18 valid: Skip more validity checks if not validating
Nick Wellnhofer 6c2bd975 2025-05-20T15:51:18 valid: Don't validate unused default attributes See erratum E9 of XML 1.0 Second Edition. See #120.
Nick Wellnhofer fca0860d 2025-05-19T21:17:39 tree: Deprecate public struct members related to DTDs Let's deprecate these members for now. If these are really used, they can be undeprecated later.
Dag-Erling Smørgrav 3ab040c2 2025-05-24T01:12:15 Fix unidiomatic use of vsnprintf(). * Don't terminate an already-terminated buffer. * Consistently use 1024-byte buffers. * While here, consistently use ap for a va_list.
Dag-Erling Smørgrav 8ea253b8 2025-05-24T01:00:25 Remove bogus casts. * Casting a string literal to `char *` and then immediately passing or assigning the result to a `const char *` makes no sense. * There is no need to cast `int` to `Py_ssize_t` as they have the same sign and the latter is at least as wide as the former.
Nick Wellnhofer 7c9b5535 2025-05-19T19:10:55 doc: Document unused error domains
Nick Wellnhofer 47aca2c6 2025-05-19T18:43:14 parser: Only check validity contraints when validating
Nick Wellnhofer 3a68d0b7 2025-05-19T18:59:51 SAX2: Handle xml:id errors separately
Nick Wellnhofer 172550d2 2025-05-18T17:45:11 parser: Only validate EnumerationTypes when requested This has quadratic behavior and is only a validity constraint.
Nick Wellnhofer 7008740a 2025-05-18T01:52:38 parser: Consolidate scanning of XML Names Use new productions by default. Fixes #194. Fixes #364. See #707.
Nick Wellnhofer 657254a8 2025-05-18T01:21:43 parser: Factor out xmlIsNameCharNew/Old
Nick Wellnhofer 315bd443 2025-05-17T18:59:52 meson: Switch to cfg_data.set10()
Nick Wellnhofer 4e5945fc 2025-05-17T14:41:28 cmake: Avoid overlinking with non-CMake libxml2-config.cmake Align libxml2-config.cmake generated by Autotools and Meson with the CMake version and only add dependencies to libraries when linking statically. Also set LIBXML_STATIC for static builds. Fixes #918.