1
0
mirror of https://gitlab.gnome.org/GNOME/libxml2.git synced 2024-10-26 20:25:14 +03:00
Commit Graph

6088 Commits

Author SHA1 Message Date
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 2023-04-28 14:28:33 +02:00
Nick Wellnhofer
6e12409b33 Regenerate docs and testapi.c 2023-04-26 21:22:17 +02:00
Nick Wellnhofer
2df2562e2b autoconf: Add AC_LANG_SOURCE to fix warning 2023-04-26 21:22:17 +02:00
Nick Wellnhofer
107e00a5be libxml2.syms: Remove LIBXML2_2.11.0 version node
This was never part of a public release and can be removed after commit
bbb2b8f1.
2023-04-26 20:39:53 +02:00
Nick Wellnhofer
3ffcc03b16 parser: Deprecate more internal functions 2023-04-26 20:23:23 +02:00
Nick Wellnhofer
b51b99ef83 testchar: Fix return value in testUserEncoding 2023-04-21 02:56:10 +02:00
Nick Wellnhofer
db32b09d50 xmllint: Validate --maxmem integer option
Fixes #520.
2023-04-20 16:22:11 +02:00
Nick Wellnhofer
250faf3c83 parser: Fix regression in xmlParserNodeInfo accounting
Commit 62150ed2 broke begin_pos and begin_line when extra node info was
recorded.

Fixes #523.
2023-04-20 15:38:00 +02:00
Nick Wellnhofer
eca1116b81 testchar: Add test for memory pull parser with encoding 2023-04-20 15:31:20 +02:00
Nick Wellnhofer
9282b08431 parser: Fix regression in memory pull parser with encoding
Revert another change from commit 98840d40.

Decode the whole buffer when reading from memory and switching to the
initial encoding. Add some comments about potential improvements.
2023-04-19 22:32:19 +02:00
Nick Wellnhofer
1db3567c9d autoconf: Warn about outdated C compilers 2023-04-19 12:19:36 +02:00
Nick Wellnhofer
33fb297b36 encoding: Fix compiler warning in ICU build 2023-04-17 14:59:47 +02:00
David Kilzer
86105c0493 Fix use-after-free in xmlParseContentInternal()
* parser.c:
(xmlParseCharData):
- Check if the parser has stopped before advancing
  `ctxt->input->cur`.  This only occurs if a custom SAX error
  handler calls xmlStopParser() on fatal errors.

Fixes #518.
2023-04-16 12:01:05 -07:00
Nick Wellnhofer
a19fa11e1d parser: Fix regression when switching input encodings
Revert some changes from commit 98840d40.

WebKit/Chromium can actually switch from ISO-8859-1 to UTF-16 in the
middle of parsing. This is a bad idea, but we have to keep supporting
this use case.
2023-04-13 15:20:56 +02:00
Nick Wellnhofer
b4d46cee80 parser: Remove first line handling in xmlParseChunk
After reworking EBCDIC detection, this isn't necessary.
2023-04-12 15:10:01 +02:00