1
0
mirror of https://gitlab.gnome.org/GNOME/libxml2.git synced 2024-10-27 04:55:04 +03:00
Commit Graph

6236 Commits

Author SHA1 Message Date
Nick Wellnhofer
be558647c1 autotools: Fix option description 2023-12-05 21:25:09 +01:00
Nick Wellnhofer
cf6e58d63c build: Disable compiler TLS by default
The global struct is quite large (~700 bytes on 64-bit systems which
will be allocated for each thread whether it uses libxml2 or not) and
already close to the total size limit on some platforms.

Disable compiler TLS by default.
2023-12-05 21:07:00 +01:00
Nick Wellnhofer
7f00273cf0 parser: Fix invalid free in xmlParseBalancedChunkMemoryRecover
Set the dictionary for newDoc in xmlParseBalancedChunkMemoryRecover.
This is a long-standing bug which was masked by

- xmlParseBalancedChunkMemoryRecover changing the document of the root
  node. This is a really bad idea, resulting in a mismatch between
  ctxt->myDoc and ctxt->node->doc.
- SAX2.c preferring ctxt->node->doc over ctxt->myDoc until commit
  a31e1b06.

Fixes #641.
2023-12-01 19:44:37 +01:00
Nick Wellnhofer
502971cc23 tree: Another fix related to #538
Should fix #639.
2023-12-01 19:44:37 +01:00
Nick Wellnhofer
4c17804050 globals: Disable TLS in static Windows builds
The cleanup callback would run after TLS was deallocated.
2023-12-01 17:19:55 +01:00
Nick Wellnhofer
c7629c9eb1 parser: Clarify documentation regarding xmlReadMemory buffer size
Fixes #638.
2023-11-30 16:52:34 +01:00
Nick Wellnhofer
e395946194 html: Reenable buggy detection of XML declarations
Switch to UTF-8 if a document starts with '<?xm' to match old behavior.
Also enable this check in the push parser.

Fixes #637.
2023-11-30 16:22:59 +01:00
Nick Wellnhofer
e2ce828c9b cmake: Update config.h.cmake.in
This should enable TLS and destructors.
2023-11-28 16:51:06 +01:00
Nick Wellnhofer
5cffba8381 Rework va_copy fallback
va_copy is a macro, so it can be detected without a feature test.
Fallback to __va_copy or memcpy.
2023-11-28 15:59:40 +01:00
Nick Wellnhofer
8707838e69 tree: Fix #583 again
Only set doc->intSubset after successful copy to avoid dangling pointers
in error case.
2023-11-28 13:45:49 +01:00
Nick Wellnhofer
de3f70146d tree: Fix regression when copying DTDs
This reverts commit d39f78069d.

Fixes #634.
2023-11-28 13:30:56 +01:00
Nick Wellnhofer
ec7f65069a tests: Fix tests --with-valid --without-xinclude
Fix a copy/paste error from commit 4eba9f9c.

Fixes #632.
2023-11-27 18:03:01 +01:00
Nick Wellnhofer
1c7f4c70fe nanohttp: Deprecate public API
The long-term plan is to remove the built-in HTTP client. There are
still a few downstream projects that use libxml2's client for other
purposes. These users should get deprecation warnings now.
2023-11-27 13:43:06 +01:00
Andre Klapper
de9af3e5a9 DOAP: Add download and issue tracker entries 2023-11-27 12:53:58 +01:00
Andre Klapper
75eb9327b4 DOAP: Replace defunct mailing list with Discourse support forum 2023-11-27 12:53:15 +01:00
Nick Wellnhofer
43b511fa71 parser: Make CRLF increment line number
Partial revert of cb927e85 fixing CRLFs not incrementing the line
number.

This requires to rework xmlParseQNameHashed. The original implementation
prompted the change to xmlCurrentChar which really shouldn't modify the
'cur' pointer as side effect. But the NEXTL macro relies on this
behavior.

Ultimately, we should reintroduce the change to xmlCurrentChar and fix
the NEXTL macro. This will lead to single CRs incrementing the line
number as well which seems more consistent.

Fixes #628.
2023-11-26 15:18:09 +01:00
Nick Wellnhofer
455c61d635 Remove VMS support
This was last updated 10 years ago and is most likely broken.
2023-11-23 15:59:41 +01:00
Nick Wellnhofer
7d6969d955 Remove Trio
Trio is a rather old cross-platform printf library which was bundled with
libxml2. It was needed for ancient pre-C99 systems without snprintf and
should be safe to remove these days.
2023-11-23 15:48:52 +01:00
Nick Wellnhofer
f5d4d33bfa tests: Regenerate testapi.c 2023-11-23 15:39:30 +01:00
Nick Wellnhofer
e42faa6d78 tests: Remove special handling of const pointers in gentest.py 2023-11-23 15:36:39 +01:00
Nick Wellnhofer
ff6c318862 include: Remove useless 'const' from function arguments 2023-11-23 15:27:00 +01:00
makise-homura
19b9c59b61 Regenerate testapi.c 2023-11-22 05:34:56 +00:00
makise-homura
a3971573b4 Don't let gentest.py cast types to 'const somethingPtr' to avoid -Wignored-qualifiers 2023-11-22 05:34:56 +00:00
makise-homura
873c171165 Avoid EDG -Wignored-qualifiers warnings on wrong 'const *' to '* const' conversions 2023-11-22 05:34:56 +00:00
makise-homura
6bc86405d1 Avoid EDG deprecation warnings for LCC compiler 2023-11-22 05:34:56 +00:00
makise-homura
c1e9f761e0 Avoid EDG -Woverflow warnings on truncating conversions by manually truncating operand 2023-11-22 05:34:56 +00:00
makise-homura
595c19a592 Avoid EDG -Wtype-limits warnings on unsigned comparisons with zero by conversion from unsigned int to int 2023-11-22 05:34:56 +00:00
makise-homura
f8394adf14 Avoid using no_sanitize attribute on EDG even if compiler shows as GCC 2023-11-22 05:34:56 +00:00
Nick Wellnhofer
f3c24112d3 autotools: Stop checking for snprintf
This works around a bug when cross-compiling to 32-bit MinGW:

https://sourceforge.net/p/mingw-w64/bugs/935/

This means that we don't fall back to the bundled Trio library if
snprintf couldn't be detected. Trio support is completely untested, most
likely broken and will be removed soon.

Fixes #625.
2023-11-22 02:12:44 +01:00
Nick Wellnhofer
a2b5c90a44 hash: Fix deletion of entries during scan
Functions like xmlCleanSpecialAttr scan a hash table and possibly delete
entries in the callback. xmlHashScanFull must detect such deletions and
rescan the entry.

This regressed when rewriting the hash table code in 4a513d56.

Fixes #626.
2023-11-21 15:28:59 +01:00
Nick Wellnhofer
aca37d8c77 parser: Only enable SAX2 if there are SAX2 element handlers
This reverts part of commit 235b15a5 for backward compatibility and
adds some comments trying to clarify the whole mess.

Fixes #623.
2023-11-20 15:20:37 +01:00
Nick Wellnhofer
272cb22313 dict: Fix '__thread' before 'static'
When used with extern or static, __thread must appear immediately after
the other storage class specifier.

Fixes #621.
2023-11-20 14:24:13 +01:00
Mike Dalessio
62d318f86c
fix: more pthread weak references in globals.c 2023-11-18 15:37:26 -05:00
Mike Dalessio
1ac88300c1 fix: pthread weak references in globals.c
Linking executables will fail on systems with glibc < 2.34 without
declaring these symbols as weak references.

In commit c19771c1f1 these references
were moved to globals.c from threads.c, but the `#pragma weak`
declarations were lost in the process.

Also removing unneeded weak declarations from threads.c.
2023-11-18 18:26:48 +00:00
Nick Wellnhofer
f92ea2ccec tests: Fix build with older MSVC
Regressed in 9b5cce7a.

Fixes #620.
2023-11-18 14:36:41 +01:00
Nick Wellnhofer
3669316ad1 Bump version 2023-11-16 13:34:03 +01:00
Nick Wellnhofer
5e9b167dce Release v2.12.0 2023-11-16 13:20:16 +01:00
Nick Wellnhofer
529df19619 parser: Don't overwrite error state in xmlParseTextDecl
Fixes a null deref in xmlLoadEntityContent found by OSS-Fuzz.
2023-11-15 12:11:33 +01:00
Nick Wellnhofer
da703eaaea schemas: Fix reallocation in xmlSchemaXPathProcessHistory
See #614.
2023-11-05 02:03:05 +01:00
Nick Wellnhofer
70cc45b81f parser: Improve attribute hash table
There's no need to grow the hash table dynamically. The size is known
which simplifies the implementation.
2023-11-05 00:49:40 +01:00
Nick Wellnhofer
5859849454 parser: Fix combination of hash values
This bug resulted in a stuck bit in hash values which can have a severe
performance impact.
2023-11-04 23:50:02 +01:00
Nick Wellnhofer
a31e1b0665 SAX2: Fix quadratic behavior in xmlSAX2AttributeNs
The last missing piece to make parsing of attributes O(n).
2023-11-04 20:21:54 +01:00
Nick Wellnhofer
a40c32ac1f doc: Regenerate documentation 2023-11-04 19:32:48 +01:00
Nick Wellnhofer
c682089421 tests: Regenerate testapi.c 2023-11-04 19:32:48 +01:00
Nick Wellnhofer
a7b037952f doc: Minor fixes for apibuild.py 2023-11-04 19:32:48 +01:00
Nick Wellnhofer
56944c517f python: Make sure to distribute new files
Add pyproject.toml and tests/setup_test.py to Makefile.am.
2023-11-04 19:32:07 +01:00
Nick Wellnhofer
7a2d412f68 parser: Copy default namespace in xmlParseBalancedChunkMemory 2023-10-31 20:19:27 +01:00
Nick Wellnhofer
e0c2f14d83 parser: Copy namespaces in xmlParseBalancedChunkMemory
Reenable copying of namespaces but don't set SAX data. This should
match the old behavior.
2023-10-31 14:04:57 +01:00
Nick Wellnhofer
89d19534de encoding: Fix decoding of large chunks
After 95e81a36, we must support XML_ENC_ERR_SPACE when using built-in
encoding handlers.

Should fix #610.
2023-10-28 03:14:13 +02:00
Nick Wellnhofer
0c18af8306 Update NEWS 2023-10-24 17:45:41 +02:00