1
0
mirror of https://gitlab.gnome.org/GNOME/libxml2.git synced 2025-04-17 18:50:07 +03:00

6202 Commits

Author SHA1 Message Date
Nick Wellnhofer
981093abd1 test: Add push parser tests for split UTF-8 sequences 2023-05-18 19:35:16 +02:00
Nick Wellnhofer
e0f3016f71 parser: Fix regression when push parsing UTF-8 sequences
Partial UTF-8 sequences are allowed when push parsing.

Fixes #542.
2023-05-18 18:21:20 +02:00
Nick Wellnhofer
687a2b719e xinclude: Lower initial table size when fuzzing
We don't have test cases with many documents, so set the initial table
size to 1 when fuzzing, so there is a chance to detect reallocation
issues.
2023-05-11 13:27:52 +02:00
Nick Wellnhofer
c40cbf07a3 malloc-fail: Fix null deref after xmlXIncludeNewRef
See #344.
2023-05-11 13:27:52 +02:00
Nick Wellnhofer
105ce73da0 xinclude: Fix false positives in inclusion loop detection
xmlXIncludeRecurseDoc can realloc the cache.
2023-05-11 13:27:52 +02:00
Nick Wellnhofer
bdb5667a5c autotools: Fix ICU detection
Fixes #540.
2023-05-10 18:13:47 +02:00
Nick Wellnhofer
9dae389cee parser: Fix "huge input lookup" error with push parser
Fix parsing of larger documents without XML_PARSE_HUGE.

Should fix #538.
2023-05-09 13:30:21 +02:00
Nick Wellnhofer
b8961df65d SAX: Always validate xml:ids
The behavior shouldn't depend on mostly random configuration options.
2023-05-09 03:25:24 +02:00
Nick Wellnhofer
f24ffddbb9 Stop using sprintf
Switch remaining users to snprintf.
2023-05-08 23:33:04 +02:00
Nick Wellnhofer
01723fc68f xpath: Fix build without LIBXML_XPATH_ENABLED
Move static function declaration into XPATH block. Also move comparison
functions.

Fixes #537.
2023-05-08 23:15:30 +02:00
Nick Wellnhofer
235b15a590 SAX: Always initialize SAX1 element handlers
Follow-up to commit d0c3f01e. A parser context will be initialized to
SAX version 2, but this can be overridden with XML_PARSE_SAX1 later,
so we must initialize the SAX1 element handlers as well.

Change the check in xmlDetectSAX2 to only look for XML_SAX2_MAGIC, so
we don't switch to SAX1 if the SAX2 element handlers are NULL.
2023-05-08 19:15:44 +02:00
Mike Dalessio
3463063001
autoconf: fix iconv library paths
and pass cflags when building executables

See 0f77167f for prior related work
2023-05-06 12:26:17 -04:00
Nick Wellnhofer
d0c3f01e11 parser: Fix old SAX1 parser with custom callbacks
For some reason, xmlCtxtUseOptionsInternal set the start and end element
SAX handlers to the internal DOM builder functions when XML_PARSE_SAX1
was specified. This means that custom SAX handlers could never work with
that flag because these functions would receive the wrong user data
argument and crash immediately.

Fixes #535.
2023-05-06 17:47:37 +02:00
Nick Wellnhofer
06a2c251a1 hash: Fix possible startup crash with old libxslt versions
Call xmlInitParser in xmlHashCreate to make it work if the library
wasn't initialized yet.

Otherwise, exsltRegisterAll from libxslt 1.1.24 or older might cause
a crash.

See #534.
2023-05-06 15:28:13 +02:00
Nick Wellnhofer
a800b7e058 regexp: Fix null deref in xmlFAFinishReduceEpsilonTransitions
Short-lived regression found by OSS-Fuzz.
2023-05-04 12:47:00 +02:00
Nick Wellnhofer
8d5e33ef3e Fix compiler warning on GCC < 8
-Wcast-function-type is only available since GCC 8.
2023-05-03 20:42:10 +02:00
Nick Wellnhofer
d6882f6454 threads: Fix startup crash with weak symbol hack
Fix another issue when running with older libc, threads and libpthread
not linked in.
2023-05-03 19:40:57 +02:00
Nick Wellnhofer
7f3f3f115f dict: Raise MAX_DICT_HASH limit
This fixes quadratic behavior with large dictionaries.

Also rework testdict.c to support tests with larger dictionaries.
2023-05-03 19:40:57 +02:00
Nick Wellnhofer
11a95279a9 win32: Don't depend on removed .def file
Fixes broken build after 21cec82b.

Fixes #532.
2023-05-02 13:36:04 +02:00
Nick Wellnhofer
c613ab14b8 regexp: Fix mistake in previous commit
The `ret = 0` line should have been deleted.

Fixes #531.
2023-05-02 00:32:50 +02:00
Nick Wellnhofer
a06eaa6119 regexp: Fix determinism checks
Swap arguments in initial call to xmlFARecurseDeterminism.

Fix the check whether we revisit the initial state in
xmlFARecurseDeterminism.

If there are transitions with equal atoms and targets but different
counters, treat the regex as deterministic but mark the transitions as
non-deterministic internally.

Don't overwrite zero return value of xmlFAComputesDeterminism
with non-zero value from xmlFARecurseDeterminism.

Most of these errors lead to non-deterministic regexes not being
detected which typically isn't an issue. The improved code may break
users who relied on buggy behavior or cause other bugs to become
visible.

Fixes #469.
2023-04-30 22:37:11 +02:00
Nick Wellnhofer
e301865e69 regexp: Fix checks for eliminated transitions
'to' can be set to -1 or -2 when eliminating transitions, so check for
all negative values.
2023-04-30 22:36:51 +02:00
Nick Wellnhofer
90759c598d regexp: Simplify xmlFAReduceEpsilonTransitions 2023-04-30 22:36:41 +02:00
Nick Wellnhofer
9f7b114232 regexp: Fix cycle check in xmlFAReduceEpsilonTransitions
The visited flag must only be reset after the first call to
xmlFAReduceEpsilonTransitions has finished. Visiting states multiple
times could lead to unnecessary processing of duplicate transitions.

Similar to 68eadabd.
2023-04-30 22:36:33 +02:00
Nick Wellnhofer
4f49017e37 tests: Test streaming schema validation 2023-04-30 21:45:39 +02:00
Nick Wellnhofer
d88763ccad schemas: Fix filename in xmlSchemaValidateFile
Make sure that filename appears in error messages.
2023-04-30 21:45:39 +02:00
Nick Wellnhofer
165f3436fc schemas: Fix line numbers in streaming validation 2023-04-30 21:45:39 +02:00
Nick Wellnhofer
57d88da675 schemas: Fix memory leak in xmlSchemaValidateStream
Regressed in 9a82b94a.

Fixes #530.
2023-04-30 21:45:39 +02:00
Nick Wellnhofer
0ffc2d82b5 runtest: Skip element name in schema error messages
This makes sure that memory and streaming tests will report the same
messages.
2023-04-30 21:45:39 +02:00
Nick Wellnhofer
550eaac605 writer: Add error check in xmlTextWriterEndDocument 2023-04-30 21:45:39 +02:00
Nick Wellnhofer
2f12e3a938 encoding: Stop calling xmlEncodingErr
This invokes the global error handler which should be avoided.
2023-04-30 21:45:39 +02:00
Nick Wellnhofer
b230861dbd xmlIO: Remove some calls to xmlIOErr
The xmlIOErr functions use the global error handler and should be
avoided if possible.
2023-04-30 21:45:39 +02:00
Nick Wellnhofer
320f5084cd parser: Improve handling of encoding and IO errors
Make sure that xmlCharEncInput, xmlParserInputBufferPush and
xmlParserInputBufferGrow set the correct error code in the
xmlParserInputBuffer. Handle errors when calling these functions.
2023-04-30 21:31:54 +02:00
Nick Wellnhofer
fc69cf568b parser: Move xmlFatalErr to parserInternals.c 2023-04-30 17:51:29 +02:00
Nick Wellnhofer
3ff6abbf58 encoding: Rework error codes
Use an enum instead of magic numbers. Fix a few error codes. Simplify
handling of "space" and "partial" errors.

See #506.
2023-04-30 16:43:29 +02:00
Nick Wellnhofer
b463b38bcd .gitignore: Split up and rearrange .gitignore files 2023-04-30 16:22:27 +02:00
Nick Wellnhofer
0260de5568 .gitignore: Add runsuite.log 2023-04-30 16:00:44 +02:00
Nick Wellnhofer
886bf4e63b Stop calling xmlMemoryDump
This was used to check for memory leaks but could potentially create a
.memdump file. These days, there are better ways to check for memory
leaks.
2023-04-30 15:48:41 +02:00
Nick Wellnhofer
fc119e3290 examples: Don't call xmlCleanupParser and xmlMemoryDump
xmlCleanupParser is dangerous and shouldn't be called in most cases.
Being part of the examples led many people to use it incorrectly.

xmlMemoryDump is an obsolete way to test for memory leaks.
2023-04-30 15:48:35 +02:00
Nick Wellnhofer
3da0931811 libxml.m4: Fix "possibly undefined macro" error
See #527.
2023-04-30 13:18:47 +02:00
Luca Niccoli
fdc9cfaa14 cmake: Fix va_copy detection
va_copy is defined by the standard as a macro, so check_function_exists
will not detect it; check_symbol_exists will.

Fixes #528.
2023-04-30 13:18:17 +02:00
Nick Wellnhofer
fa993130f9 xpath: Remove remaining references to valueFrame
Fixes #529.
2023-04-30 13:18:17 +02:00
Nick Wellnhofer
a5bc460583 cmake: Link with --undefined-version 2023-04-29 20:43:54 +02:00
Nick Wellnhofer
a8fe4900be autoconf: Only use --undefined-version with version scripts 2023-04-29 20:17:38 +02:00
Nick Wellnhofer
85d4aba426 libxml.m4: Fix quoting
Should fix #527.
2023-04-29 19:48:50 +02:00
Nick Wellnhofer
d8f6e7602c Link with --undefined-version
lld 16 defaults to --no-undefined-version but the version script can
contain symbols disabled by configuration options.

See #473.
2023-04-29 19:12:23 +02:00
Nick Wellnhofer
131c2dec69 libxml2.syms: Revert removal of version information
Removing version information caused problems when relinking with shared
libraries depending on libxml2. It also broke the ABI on Android.

Revert libxml2.syms to the 2.10.0 version.

Fixes #526.
2023-04-29 18:59:41 +02:00
Nick Wellnhofer
8979d739eb Clean up .gitignore
Remove stuff which probably shouldn't be ignored.
2023-04-28 20:22:05 +02:00
Nick Wellnhofer
e07f765f59 Bump version to 2.12.0 2023-04-28 14:51:06 +02:00
Nick Wellnhofer
f296934ade Release v2.11.0 v2.11.0 2023-04-28 14:28:33 +02:00