Nick Wellnhofer
fa81e849be
xmllint: Fix --memory --repeat
...
Always reset parser context.
Should fix #937 .
2025-06-08 14:22:32 +02:00
Nick Wellnhofer
220c813e35
globals: Fix documentation of xmlThrDef* functions
2025-06-08 14:22:32 +02:00
Nick Wellnhofer
7e08d93c94
doc: Improve documentation of tree data types
2025-06-08 14:22:32 +02:00
Nick Wellnhofer
86cf217d34
build: Disable Schematron support by default
2025-06-08 14:22:32 +02:00
Nick Wellnhofer
8da19f2320
doc: Add more warnings to xmlCleanupParser
2025-06-08 14:22:32 +02:00
Alex Richardson
7e4247b278
parser: use XML_INT_TO_PTR when storing integers as pointers
...
This fixes warnings when using a CHERI-aware toolchain.
2025-06-06 12:11:54 -07:00
Nick Wellnhofer
c6206c9387
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.
2025-06-05 22:24:50 +02:00
Nick Wellnhofer
2b6b3945f2
Revert "SAX1: Align handling of default attributes with SAX2"
...
This reverts commit db65b2fc51 .
This didn't check for duplicate default attributes.
2025-06-03 16:21:56 +02:00
Nick Wellnhofer
30375877d9
parser: Fix custom SAX parsers without cdataBlock handler
...
Use characters handler if cdataBlock handler is NULL.
Regressed with 57e4bbd8 . Should fix #934 .
2025-06-03 16:21:48 +02:00
Nick Wellnhofer
5e7c72cd5c
doc: Misc fixes
2025-06-03 01:27:12 +02:00
Nick Wellnhofer
5f8e537d0a
doc: Misc fixes to xpointer
2025-06-03 00:59:00 +02:00
Nick Wellnhofer
1fc66d265a
xmllint: Don't check for removed features
2025-06-03 00:33:27 +02:00
Nick Wellnhofer
479f26f92f
regexp: Remove unfinished reimplementation
...
This was never enabled.
2025-06-03 00:28:16 +02:00
Nick Wellnhofer
3d71ab4fa6
doc: Small fixes
2025-06-03 00:17:03 +02:00
Nick Wellnhofer
0ab5d7c557
entities: Deprecate internal DTD-related functions
2025-06-03 00:13:26 +02:00
Nick Wellnhofer
347c2b2ec7
valid: Deprecate a few functions and xmllint --insert
2025-06-02 23:54:28 +02:00
Nick Wellnhofer
f6eec6f4c1
globals: Remove lineNumbersDefaultValue from globals struct
2025-06-02 22:45:19 +02:00
Nick Wellnhofer
ac6ae39192
valid: Readd more argument checks in xmlAddElementDecl
...
Fix crashes with API fuzzer.
2025-06-02 14:33:15 +02:00
Nick Wellnhofer
0f8543e11d
parser: Fix error reporting in xmlSkipBlankCharsPEBalanced
...
Short-lived regression.
2025-06-02 14:19:01 +02:00
Nick Wellnhofer
6a6a46f017
doc: Fix autolink errors
...
Fix links, remove links to internal functions.
2025-05-28 16:02:41 +02:00
Nick Wellnhofer
7bd8d1d9cc
doc: Prefix autolinks with '#'
...
Use `#func` instead of `func()` to ignore parameters and make all
autolinks work.
2025-05-28 16:01:52 +02:00
Nick Wellnhofer
6e33d136e1
error: Fix initGenericErrorDefaultFunc compatibility macro again
...
Now it really should work as before.
2025-05-28 14:57:37 +02:00
Nick Wellnhofer
8baa5de182
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).
2025-05-27 20:03:13 +02:00
Nick Wellnhofer
35d04a0848
README: Set expectations straight
...
Fixes #913 .
2025-05-27 20:03:13 +02:00
Nick Wellnhofer
ad346c9a24
tree: Fix integer overflow in xmlBuildQName
...
This issue affects memory safety and might receive a CVE ID later.
Fixes #926 .
2025-05-27 20:03:13 +02:00
Nick Wellnhofer
77c583e0f7
valid: Readd argument check in xmlAddElementDecl
...
Fix crashes with API fuzzer.
2025-05-27 19:55:36 +02:00
Nick Wellnhofer
78454e30e9
io: Remove xmlInputDefaultOpen
...
Not necessary after removal of HTTP client.
2025-05-27 19:55:36 +02:00
Nick Wellnhofer
b79cf4743b
globals: Fix memory leak on Windows DLL unload
...
Thread-local memory must be freed for the main thread as well after
4f08a1a2 .
Fixes #925 .
2025-05-27 19:54:59 +02:00
Nick Wellnhofer
ab06bfa1f6
parser: Fix error return in xmlParseElementContentDecl
...
Avoid internal error later in xmlValidBuildAContentModel after
2a60ca06c .
Also avoids some unnecessary error messages.
2025-05-26 16:51:59 +02:00
Nick Wellnhofer
30cf6d0980
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.
2025-05-26 16:51:59 +02:00
Nick Wellnhofer
34bafa14fe
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.
2025-05-25 22:47:34 +02:00
Nick Wellnhofer
997830a338
tests: Always use xmlMalloc/xmlFree
2025-05-25 22:47:34 +02:00
Nick Wellnhofer
c136118dcc
README: Mention CMake single/multi-config
2025-05-25 14:26:30 +02:00
Nick Wellnhofer
4dc44c83ab
parser: Rework entity boundary check for element content
...
Only use depth of input stack. This makes the input ID unused
internally.
2025-05-25 14:26:30 +02:00
Nick Wellnhofer
74ea6b483c
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.
2025-05-25 14:26:30 +02:00
Nick Wellnhofer
6f8ac9538c
valid: Don't use element namespace for attributes
...
This makes no sense. Unprefixed attributes never have a namespace.
2025-05-25 14:26:30 +02:00
Nick Wellnhofer
5ec83f7741
valid: Remove duplicate #FIXED check for namespaces
...
Unlike the comment indicates, this is already checked.
2025-05-25 14:26:30 +02:00
Nick Wellnhofer
7c10fff265
valid: Don't validate twice in xmlAddAttributeDecl
...
This should only be done in xmlValidateAttributeDecl.
2025-05-25 14:26:30 +02:00
Nick Wellnhofer
db65b2fc51
SAX1: Align handling of default attributes with SAX2
...
The SAX1 parser is legacy code, but it seems more maintainable to align
it with SAX2.
2025-05-25 14:26:30 +02:00
Nick Wellnhofer
e4cbc295fa
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 .
2025-05-25 14:26:30 +02:00
Nick Wellnhofer
682195c869
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 .
2025-05-25 14:26:30 +02:00
Nick Wellnhofer
74ff6c0028
error: Fix line number in entities
...
Allow line numbers from more domains, see code above.
2025-05-25 14:26:30 +02:00
Nick Wellnhofer
2f3655c9c3
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.
2025-05-25 14:26:30 +02:00
Nick Wellnhofer
2a60ca06c0
valid: Don't check enum values
...
Rely on the parser to pass valid arguments.
2025-05-25 14:26:30 +02:00
Nick Wellnhofer
4aa7192f21
tests: Add dtor for xmlElementContent in testapi.c
2025-05-25 14:26:30 +02:00
Nick Wellnhofer
fc1cabc822
valid: Also raise duplicate ID error without validation support
...
Whether an error is raised should not depend on config options.
2025-05-25 14:26:30 +02:00
Nick Wellnhofer
dd1961e0d8
valid: Skip more validity checks if not validating
2025-05-25 14:26:30 +02:00
Nick Wellnhofer
6c2bd9758f
valid: Don't validate unused default attributes
...
See erratum E9 of XML 1.0 Second Edition.
See #120 .
2025-05-25 14:26:30 +02:00
Nick Wellnhofer
fca0860d6c
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.
2025-05-25 14:26:30 +02:00
Dag-Erling Smørgrav
3ab040c203
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.
2025-05-24 01:28:49 +02:00