Nick Wellnhofer
4b1832c115
relaxng: Use error handler for internal errors
...
Don't print to stderr.
2024-07-15 16:33:38 +02:00
Nick Wellnhofer
728869809e
error: Add helper functions to print errors and abort
2024-07-15 16:33:38 +02:00
Nick Wellnhofer
f6170b489c
memory: Don't report OOM to stderr
2024-07-15 16:33:38 +02:00
Nick Wellnhofer
6be79014d7
Remove unused code
2024-07-15 16:33:38 +02:00
Nick Wellnhofer
fee0006a06
parser: Fix memory leak after malloc failure in xml*ParseDTD
2024-07-15 13:03:55 +02:00
Nick Wellnhofer
69f12d6d47
encoding: Deprecate xmlByteConsumed
...
This was only used by Chromium/WebKit to detect whether xmlParseContent
really succeeded. It's a horrible, overcomplicated hack.
See 8c5848bd
and #767 .
2024-07-13 15:42:02 +02:00
Nick Wellnhofer
440d11afd4
reader: Deprecate xmlTextReaderByteConsumed
...
Document that this function is useless.
Stop trying to handle encoding via xmlByteConsumed which can be
expensive.
2024-07-13 15:42:02 +02:00
Nick Wellnhofer
3528b81f8a
tools: Move codegen tools to 'tools' directory
2024-07-13 15:42:02 +02:00
Nick Wellnhofer
c3b2f4713c
cmake: Update option description
2024-07-13 15:42:02 +02:00
Nick Wellnhofer
3048793251
meson: Also disable icu and thread_alloc by default
2024-07-13 15:42:02 +02:00
Nick Wellnhofer
aa6aec19b0
parser: Fix xmlInputSetEncodingHandler again
...
Short-lived regression.
2024-07-11 12:42:13 +02:00
Nick Wellnhofer
8af55c8d20
parser: Rename new input API functions
...
These weren't made public yet.
2024-07-11 01:33:29 +02:00
Nick Wellnhofer
d74ca59491
parser: Rename internal xmlNewInput functions
2024-07-11 01:31:50 +02:00
Nick Wellnhofer
4f329dc524
parser: Implement xmlCtxtParseContent
...
This implements xmlCtxtParseContent, a better alternative to
xmlParseInNodeContext or xmlParseBalancedChunkMemory. It accepts a
parser context and a parser input, making it a lot more versatile.
xmlParseInNodeContext is now implemented in terms of
xmlCtxtParseContent. This makes sure that xmlParseInNodeContext never
modifies the target document, improving thread safety.
xmlParseInNodeContext is also more lenient now with regard to undeclared
entities.
Fixes #727 .
2024-07-11 01:26:32 +02:00
Nick Wellnhofer
673ca0edaf
tests: Regenerate testapi.c
2024-07-11 01:23:57 +02:00
Nick Wellnhofer
4fec0889e0
parser: Fix memory leak in xmlInputSetEncodingHandler
...
Short-lived regression.
2024-07-10 22:32:33 +02:00
Nick Wellnhofer
d099795611
encoding: Readd some UTF-8 validation to encoders
...
This isn't strictly needed but avoids generating invalid UTF-16 and
unsigned integer overflows.
2024-07-10 22:26:19 +02:00
Nick Wellnhofer
ae6e2ee7ec
fuzz: Adjust reader fuzzer
2024-07-10 22:26:11 +02:00
Nick Wellnhofer
f48eefe3d0
encoding: Rework xmlByteConsumed
...
Don't loop infinitely if input buffer is too large. Allocate conversion
buffer on the heap.
2024-07-09 14:25:32 +02:00
Nick Wellnhofer
8c4cc0be35
fuzz: Improve debug output of reader fuzzer
2024-07-09 14:25:16 +02:00
Nick Wellnhofer
5935471732
parser: Fix malloc failure handling in xmlInputSetEncodingHandler
...
Don't set encoder if allocating buffer failed. This could lead to
xmlByteConsumed processing invalid UTF-8.
2024-07-09 14:11:28 +02:00
Nick Wellnhofer
da68639926
io: Fix return value of xmlFileRead
...
This broke in commit 6d27c54
.
Fixes #766 .
2024-07-09 13:02:31 +02:00
Nick Wellnhofer
f51ad063a7
parser: Fix error return of xmlParseBalancedChunkMemory
...
Only return an error code if the chunk is not well-formed to match the
2.12 behavior. Return 0 on non-fatal errors like invalid namespaces.
Fixes #765 .
2024-07-08 11:28:33 +02:00
Nick Wellnhofer
2e63656ec6
parser: Check return value of inputPush
...
inputPush typically doesn't fail because we pre-allocate the input
table. The return value should be checked nevertheless.
2024-07-08 11:27:52 +02:00
Nick Wellnhofer
ea31ac5bba
fuzz: Fix spaceMax
2024-07-07 04:19:09 +02:00
Nick Wellnhofer
82e0455cf6
Undeprecate some symbols for now
...
- xmlKeepBlanksDefault is needed as a work-around for
xmlParseBalancedChunk, see issue #727 .
- ctxt->options already has an accessor and will be deprecated
later.
- input->cur, input->base, input->end: See #762 .
2024-07-06 20:19:51 +02:00
Nick Wellnhofer
29e3ab92f0
fuzz: Make reallocs more likely
2024-07-06 15:48:43 +02:00
Nick Wellnhofer
de3221b179
fuzz: Adjust for xmlNodeParseContent changes
...
xmlStringGetNodeList returns NULL again for empty strings.
2024-07-06 15:33:06 +02:00
Nick Wellnhofer
1e5375c1b4
SAX2: Check return value of xmlPushInput
...
Fix null deref in case of malloc failure.
2024-07-06 15:33:06 +02:00
Nick Wellnhofer
38195cf596
parser: Don't produce names with invalid UTF-8 in recovery mode
2024-07-06 15:33:06 +02:00
Nick Wellnhofer
c45c15f5af
ci: Add job for perl-XML-LibXML
2024-07-04 15:47:49 +02:00
Nick Wellnhofer
ec0881099b
parser: Upgrade XML_IO_NETWORK_ATTEMPT to error
...
Fixes XML::LibXML test suite.
2024-07-04 15:47:20 +02:00
Nick Wellnhofer
f86d17c163
encoding: Fix xmlParseCharEncoding
...
Make "UTF-16" return the UTF16LE handler as before.
Fix error return.
2024-07-04 15:47:20 +02:00
Nick Wellnhofer
10082a3d54
testchar: Don't invoke encoding handler directly
2024-07-04 15:47:20 +02:00
Mike Dalessio
446a3610fd
test: add a downstream integration test job for nokogiri
...
Related to #758
2024-07-04 13:30:48 +00:00
Andrew Potter
67fa4a43f3
meson: Disable python when python is disabled
2024-07-03 13:40:04 -07:00
Nick Wellnhofer
e2a49afe3e
build: Read version number from VERSION file
2024-07-03 20:32:23 +02:00
Nick Wellnhofer
c3731347c4
build: Introduce LIBXML_MINOR_COMPAT
...
This is set to 0 for now but could be used to avoid ABI stability
issues.
2024-07-03 18:33:16 +02:00
Nick Wellnhofer
606310a381
meson: Set soversion
2024-07-03 18:05:05 +02:00
Nick Wellnhofer
944cc23c84
tree: Fix handling of empty strings in xmlNodeParseContent
...
We shouldn't create an empty text node to match the old behavior.
Fixes #759 .
2024-07-03 16:07:10 +02:00
Nick Wellnhofer
46ec621eb7
encoding: Clarify xmlUconvConvert
2024-07-03 16:06:59 +02:00
Nick Wellnhofer
48fec2429b
encoding: Remove duplicate code
...
Fix recent commit.
2024-07-03 15:11:20 +02:00
Nick Wellnhofer
71fb257912
encoding: Fix ICU build
2024-07-03 14:35:49 +02:00
Nick Wellnhofer
80aabea1d6
SAX2: Reenable 'directory' as base URI fallback
...
Apparently, some users overwrite this member manually to set a base URI
for memory streams.
Fixes #753 .
2024-07-03 11:55:38 +02:00
Nick Wellnhofer
842a044831
valid: Restore ID lookup
...
Revert a change from d025cfbb
and don't overwrite ID table entries, so
that the first attribute will be returned if there are duplicate IDs.
This requires two other changes:
- Attributes in entity content are never added to the ID table. This
seems reasonable.
- Remove the optimization to skip ID lookup when copying and the target
document has an empty ID table. This also seems more correct since the
document could have ID declarations nevertheless or we could be
copying xml:ids into the document for the first time.
Fixes #757 .
2024-07-03 11:46:06 +02:00
Nick Wellnhofer
f906526175
SAX2: Fix HTML IDs
...
Short-lived regression. Fixes #755 .
2024-07-02 23:59:28 +02:00
Nick Wellnhofer
785ed5c4cd
meson: Don't auto-enable legacy and tls
...
These features should be requested explicitly.
2024-07-02 23:03:46 +02:00
Nick Wellnhofer
96d850c3cb
save: Fix "Factor out xmlSaveWriteIndent"
2024-07-02 22:43:49 +02:00
Nick Wellnhofer
205e56dafe
parser: Undeprecate ctxt->directory
2024-07-02 22:32:43 +02:00
Nick Wellnhofer
8fb1dc9a62
Clarify xpointer() extension removal
2024-07-02 22:17:08 +02:00