1
0
mirror of https://gitlab.gnome.org/GNOME/libxml2.git synced 2026-01-26 21:41:34 +03:00
Commit Graph

7696 Commits

Author SHA1 Message Date
Nick Wellnhofer
48df82f6ea Bump version to 2.16.0 2025-09-15 13:57:30 +02:00
Nick Wellnhofer
0bea77c828 Release v2.15.0 v2.15.0 2025-09-15 13:34:13 +02:00
Nick Wellnhofer
b9943bcaa3 Remove legacy win32 build system 2025-09-10 18:07:39 +02:00
Nick Wellnhofer
347147b555 Update NEWS 2025-09-08 16:02:59 +02:00
Nick Wellnhofer
1763281cd6 Remove LZMA support 2025-09-08 15:30:53 +02:00
Nick Wellnhofer
063add1b29 parser: Always require XML_PARSE_UNZIP to enable decompression 2025-09-08 15:14:33 +02:00
Nick Wellnhofer
8c107b690b Revert "dict: Rework reference counting"
This reverts commit 18bbdb5117 due to lack
of feedback.
2025-09-08 14:59:24 +02:00
Nick Wellnhofer
13962f820e valid: Fix null deref in xmlValidateOneAttribute
Short-lived regression from d53ba058.
2025-08-25 12:29:55 +02:00
Nick Wellnhofer
e397651a62 cmake: Omit version number from cmake install dir
Align with other build systems. Fixes #973.
2025-08-24 20:08:17 +02:00
Nick Wellnhofer
d53ba0588e valid: Don't add ids when validating entity content
The id table shouldn't reference ids in entities. The id will be created
when expanding the entity.

Probably regressed with d025cfbb.

Note that we still register ids in entities if entities are not
replaced. This is required to make IDREF checks work.

Fixes #974.
2025-08-23 14:59:55 +02:00
Nick Wellnhofer
56199b5c08 catalog: Prepare to make SGML catalog support optional 2025-08-20 13:09:03 +02:00
Nick Wellnhofer
e2fdef4510 tests: Update testapi.c 2025-08-20 13:09:03 +02:00
Nick Wellnhofer
591f19ebe7 catalog: Deprecate low-level internal functions 2025-08-20 13:09:03 +02:00
Samuel Thibault
5bd6b44d13 Fix initGenericErrorDefaultFunc(NULL)
Calling initGenericErrorDefaultFunc(NULL) currently yields to

/usr/include/libxml2/libxml/xmlerror.h:23:45: error: invalid use of void expression
   23 |     xmlSetGenericErrorFunc(NULL, (h) ? *(h) : NULL)

Indeed, even if h is nul, the compiler will try to give a type to *(h),
which can't work.
2025-08-20 10:23:54 +02:00
Francesco Pretto
ca10c7d7b5 relaxng: Added xmlRelaxNGValidCtxtClearErrors to recover from errors during streaming validation
This allows to perform XML element validation skipping errors without recreating
a validation context. Tested it in runsuite.c in the rngTestStreaming() method.

Also added xmlRegExecClearErrors(exec) as necessary.
2025-08-18 10:18:41 +00:00
Nick Wellnhofer
f92a7a50d3 ci: Fix MSVC test by setting CMake generator manually
Visual Studio 2017 was removed from the Windows runners, but CMake still
picked it up for some reason.
2025-08-16 15:01:16 +02:00
Nick Wellnhofer
18bbdb5117 dict: Rework reference counting
Use C11 atomics if available. Otherwise, fall back to pthread mutex
inlined in xmlDict struct or Win32 atomics.

This should fix lock contention reported in #970.
2025-08-16 14:37:14 +02:00
Nick Wellnhofer
24caea6383 regexp: Avoid integer overflow and OOB array access
Limit size of 2D arrays to XML_MAX_ITEMS (1e9) to avoid overflow of int
indexes.

Fixes #950.
2025-08-12 18:47:00 +02:00
Nick Wellnhofer
c4b278ecd3 valid: Undeprecate xmlAdd*Decl
Fixes #969.
2025-08-11 13:44:56 +02:00
Nick Wellnhofer
f1e1f13b76 tree: Guard against atype corruption
Always remove ids if `id` member is set.

Untested, but this should fix CVE-2025-7425 reported against libxslt:

https://gitlab.gnome.org/GNOME/libxslt/-/issues/140
2025-08-05 22:59:31 +02:00
Nick Wellnhofer
152fbb60a9 parser: Make sure to stop parser before checking max errors
Short-lived regression from 7a41b18c.
2025-08-03 18:26:29 +02:00
Nick Wellnhofer
149c04c02d html: Escape < and > when serializing attributes
This reverts the change in cdaf657f. Coincidentally, the HTML spec just
changed to mandate the old escaping behavior:

https://github.com/whatwg/html/issues/6235

Fixes #957.
2025-08-02 15:03:18 +02:00
Nick Wellnhofer
3b96ec75ab doc: Document deprecated default SAX handler globals 2025-08-02 14:12:17 +02:00
Nick Wellnhofer
00314882ed meson: Add -Wmissing-variable-declarations
Originally clang-only, gcc supports this option since version 14.

This catches errors like #961.
2025-08-01 15:46:08 +02:00
Nick Wellnhofer
37bd4b284a globals: Include HTMLparser.h, fixing Windows build
Regressed with c011e760 and 85bd58ef.

Fixes #961.
2025-08-01 15:30:46 +02:00
Nick Wellnhofer
43f7ff0a9e tests: Make global variables static 2025-08-01 15:27:11 +02:00
Nick Wellnhofer
8436916097 doc: Add another warning to XML_PARSE_DTDVALID
While most parts of libxml2, including the parser, are still vulnerable
to such attacks, it is unlikely that DTD validation will ever be fixed.
2025-07-31 15:20:20 +02:00
Nick Wellnhofer
859899a87e doc: Document option handling of deprecated "SAX1" functions 2025-07-31 15:20:20 +02:00
Nick Wellnhofer
ab4a7f3011 doc: Document deprecated xmlBuffer members 2025-07-31 15:20:20 +02:00
Nick Wellnhofer
af464de1f3 io: Deprecate xmlOutputBuffer members 2025-07-31 15:20:20 +02:00
Nick Wellnhofer
6c0188549b io: Deprecate xmlParserInputBuffer members 2025-07-31 15:20:20 +02:00
Nick Wellnhofer
2cc77c3a81 fuzz: Stop using xmlParserInputBuffer 2025-07-31 15:20:20 +02:00
Nick Wellnhofer
7deae0f80f python: Switch to *CreateIO functions
Avoid using deprecated struct members.
2025-07-31 15:20:20 +02:00
Nick Wellnhofer
d1c3391eaf tests: Silence testparser
Regressed with bd9d5e39.
2025-07-31 15:20:20 +02:00
Nick Wellnhofer
8689523ad9 parser: Implement xmlCtxtGetInputWindow
See #762.
2025-07-31 15:20:20 +02:00
Nick Wellnhofer
469c847f4d parser: Split out xmlParserInputGetWindow 2025-07-31 14:23:23 +02:00
Nick Wellnhofer
8aaa53d712 parser: Implement xmlCtxtGetInputPosition
See #762.
2025-07-31 14:23:23 +02:00
Nick Wellnhofer
144ed959a5 parser: Move xmlSaturatedAdd to private header 2025-07-31 14:23:23 +02:00
Nick Wellnhofer
e3daef5c78 parser: Fix xmlSaturatedAddSizeT argument type
This is only used for entity size accounting. The bug only affected
platforms where sizeof(long) != sizeof(size_t) and was probably
harmless.
2025-07-31 14:23:23 +02:00
Nick Wellnhofer
a7fc9e1add parser: Add more parser context accessors
The only thing remaining is access to parser input, see #762.
2025-07-31 14:23:23 +02:00
Nick Wellnhofer
a2562b9d8a doc: Improve documentation of error levels 2025-07-31 14:23:23 +02:00
Nick Wellnhofer
7a41b18c62 parser: Remove xmlHaltParser
Always halt the parser on resource limit and entity loop errors and
remove the remaining calls which seem unnecessary.
2025-07-31 14:23:23 +02:00
Nick Wellnhofer
cdf4c6f1a2 doc: Mention XML_PARSE_NOERROR in more places 2025-07-31 14:23:23 +02:00
Nick Wellnhofer
77700d3d0a doc: Mention tree API bugs in old versions 2025-07-31 14:23:23 +02:00
Nick Wellnhofer
c5e7ff09b2 tree: More xmlNodeParseContent cleanup
- Rename to xmlNodeParseAttValue
- Rework argument types
- Remove wrapper function
2025-07-31 14:23:23 +02:00
Caolán McNamara
408bd0e18e const up allowPCData
similar to htmlScriptAttributes
2025-07-24 11:13:58 +01:00
Nick Wellnhofer
0a4fe2f94a io: Fix argument type
See c70d88f1 and #951.
2025-07-20 18:52:06 +02:00
Nick Wellnhofer
e117405749 tree: Don't reference recursive entities in xmlNodeParseContent
Improve protection against entity cycles when using tree API.
2025-07-20 13:10:15 +02:00
Nick Wellnhofer
c70d88f19a io: Fix reading from pipes like stdin on Windows
On Windows, lseek doesn't return an error on unseekable streams like
pipes.

Fixes #951.
2025-07-20 13:10:15 +02:00
Peter Kokot
8f1cc9151e CMake: Add selector to CMAKE_DL_LIBS transformation
At the time of writing, on AIX, the CMAKE_DL_LIBS is set to "-lld",
which presents the dependency for using dynamic loading on some old AIX
versions. This ensures that resulting list of linker flags on AIX is
also properly formatted (without adding additional "-l").
2025-07-18 22:43:49 +02:00