1
0
mirror of https://gitlab.gnome.org/GNOME/libxml2.git synced 2026-01-26 21:41:34 +03:00

7744 Commits

Author SHA1 Message Date
Steve Lhomme
2cc5834033 threads: don't force _WIN32_WINNT to Vista if it's set to a higher value
This will prevent Universal Windows Platform (UWP) targeting Windows 10+ to fail.
Some UWP API's that are XP/Vista/7 API's are not available in Windows 8 but available in Windows 10.
So if Windows 10 is targetting we should not pretend to build for Windows Vista (0x0600).

If the user didn't set a _WIN32_WINNT value, the Windows SDK/mingw-w64 have a
default value that will be used. We can use sdkddkver.h to get that value.
If the default value is Windows 10 we should not lower it either.
2026-01-24 06:38:40 +00:00
Daniel Garcia Moreno
deed3b7873 catalog: Do not check value for duplication nextCatalog
The value field stores the path as it appears in the catalog definition,
the URL is built using xmlBuildURI that changes the relative paths to
absolute.

This change fixes the issue of using relative path to the same catalog
in the same file.

Fix https://gitlab.gnome.org/GNOME/libxml2/-/issues/1040
2026-01-21 13:29:08 +00:00
Daniel Garcia Moreno
f8399e62a3 testcatalog: Add new tests for catalog.c
Adds a new test program to run specific tests related to catalog
parsing.

This initial version includes a couple of tests, the first one to check
the infinite recursion detection related to:
https://gitlab.gnome.org/GNOME/libxml2/-/issues/1018.

The second one tests the nextCatalog element repeated parsing, related
to:
https://gitlab.gnome.org/GNOME/libxml2/-/issues/1019
https://gitlab.gnome.org/GNOME/libxml2/-/issues/1040
2026-01-21 13:29:08 +00:00
Daniel Garcia Moreno
19549c6159 Add RelaxNG include limit
This patch adds a default xmlRelaxNGIncludeLimit of 1.000, and that
limit can be modified at runtime with the env variable
RNG_INCLUDE_LIMIT.

Fix https://gitlab.gnome.org/GNOME/libxml2/-/issues/998
2026-01-14 09:47:23 +00:00
James Lan
354f620a45 build: compile option WINPATH to allow processing Windows path on other platforms 2026-01-14 07:38:48 +00:00
emptyiscolor
34b3c5dd83 move src to expected path 2026-01-14 07:25:11 +00:00
emptyiscolor
24a0ceca5c test with fuzzing harnesses 2026-01-14 07:25:11 +00:00
emptyiscolor
51035e7068 downstream of fuzzing harnesses 2026-01-14 07:25:11 +00:00
Daniel Garcia Moreno
0e50b31902 Ignore next/prev of documents when traversing XPath
See https://gitlab.gnome.org/GNOME/libxml2/-/issues/996
2026-01-14 07:14:04 +00:00
Trevor Gamblin
b45e38edab testlimits: optionally accept '-timeout' input
Fixes: #1032

The testlimits tests can use a lot of system resources, and thus they
may fail when run on systems under heavy load, given that the default
parsing timeout is set to two seconds. Retain this default value, but
make the timeout length configurable with a new '-timeout' flag.

Signed-off-by: Trevor Gamblin <tgamblin@baylibre.com>
2026-01-12 09:21:54 -05:00
Petr Simecek
4c3f00ba39 parser: Fix infinite loop in xmlCtxtParseContent
The loop to find an element/document ancestor uses "cur = node->parent"
as the iterator instead of "cur = cur->parent". This causes an infinite
loop when the immediate parent is not an element/document/html node
(e.g., when the node's parent is an entity reference).

Fix by iterating with cur->parent to properly walk up the ancestor chain.

Add regression test to testparser.c.

Fixes: 4f329dc5 ("parser: Implement xmlCtxtParseContent")
2026-01-07 12:25:19 +00:00
Daniel Garcia Moreno
f75abfcaa4 catalog: Ignore repeated nextCatalog entries
This patch makes the catalog parsing to ignore repeated entries of
nextCatalog with the same value.

Fix https://gitlab.gnome.org/GNOME/libxml2/-/issues/1019
2026-01-05 09:30:19 +00:00
Daniel Garcia Moreno
1961208e95 catalog: prevent inf recursion in xmlCatalogXMLResolveURI
Fix https://gitlab.gnome.org/GNOME/libxml2/-/issues/1018
2026-01-05 09:30:19 +00:00
Nathan
eae9291aa7 fix: Prevent infinite recursion in xmlCatalogListXMLResolve 2026-01-04 16:01:55 +02:00
Sandino Araico Sanchez
9827e6e446 Note on xmlTextWriterWriteBase64 about no safety check 2025-12-22 14:45:41 -06:00
Michael Heilmann
e118d6376c update CMakeLists
before:
- private *.h files were not displayed in Visual C++
- source files were not grouped in Visual C++

now:
- private *.h files are displayed in Visual C++
- source files are grouped in Visual C++
2025-12-22 09:10:54 +00:00
Iván Chavero
84b8530d85 Fix xmlOutputBufferGetContent output when encoder is set.
The xmlOutputBufferGetContent function only returns the buffer attribute
of the _xmlOutputBuffer struct.
When the `encoder` attribute is set the content is stored in the `conv`
attribute after conversions are performed and the `buffer` attribute is
emptied. This causes the xmlOutputBufferGetContent to always return
empty when the `encoder` is set.

This patch fixes the function by returning the `conv` attribute when the
encoder is set.

Fixes: #991
2025-12-22 09:51:22 +01:00
Daniel Garcia Moreno
3b2d4638ec Add /build and /install directories to gitignore 2025-12-16 07:41:35 +01:00
Peter Fordham
cee7107a1b writer: Add a few extra NULL checks to avoid memory leaks on corrupt writer path. 2025-12-15 11:48:41 -08:00
Peter Fordham
aef94414c6 Initialize pointer incase we end up skipping the while loop completely. 2025-12-14 21:09:21 -08:00
Niels Dossche
98194640b8 Fix memory leak of prefix in xmlTextWriterStartElementNS() 2025-12-12 14:26:11 -06:00
Michal Privoznik
bcaae46a31 meson: Add valgrind test setup
Similarly to libtools, add a test setup to meson so that tests
can be run under valgrind even with meson:

  meson test -C $builddir --setup valgrind

Since meson has a timeout for individual tests (30 seconds) and
valgrind makes everything run slower, the timeout needs to be
increased (factor of 4 looks good enough).

Signed-off-by: Michal Privoznik <mprivozn@redhat.com>
2025-12-12 12:24:40 +00:00
Michal Privoznik
e2f7674871 autotools: Make valgrind actually check for leaks
Problem with libtools is that it produces shell scripts which
then set LD_LIBRARY_PATH and execute actual binary (hidden in
.libs dir). Therefore, running 'valgring ./testbinary' doesn't do
anything useful (beside checking for memleaks in shell). We want
to use `libtool --mode=execute valgrind ./testbinary`.

With that fixed, next step is to make valgrind return a non-zero
value if a memleak is detected (--error-exitcode=). And to show
individual memleaks let's use --leak-check=full.

Signed-off-by: Michal Privoznik <mprivozn@redhat.com>
2025-12-12 12:24:40 +00:00
Peter Fordham
6555048b24 Add tests that relied on POSIX shell script to native CMake. 2025-12-12 11:11:11 +00:00
Herman Semenoff
68f91d1893 xmlstring: fix access out-of-bound array if len <= 0 2025-12-12 10:56:44 +00:00
gabriel desharnais
c6167cf3b9 fix to issue 227 adding xpath0 to xmllint 2025-12-11 11:25:04 -05:00
Nick Wellnhofer
a30a4e6efc xmllint: Use zlib directly for output 2025-12-11 09:25:47 +00:00
Nick Wellnhofer
956dfd2ddd xmllint: Use zlib directly
This prepares xmllint for eventually removing decompression support from
libxml2.
2025-12-11 09:25:47 +00:00
Daniel Garcia Moreno
0704f52ea4 readme: Write a more possitive Security section
This patch changes the security section in the README.md file to give
more information.

This removes the "unmaintained" text, as this project is maintained
again. It also makes it clear that this is a community project, so
anyone will know what to expect, and it also makes explicit that
developers are volunteers and will work on the issues that they want, as
a try to avoid pressure from bug reporters.

The message try to be possitive, promoting collaboration instead of
conflict. The idea is to make it clear that collaboration is welcome and
the way to go is to do it yourself instead of asking the maintainers to
do it for you.
2025-12-10 09:51:48 -06:00
Daniel Garcia Moreno
160c8a43ba shell: free cmdline before continue
This patch frees the cmdline when it's not empty but it doesn't contain
any actual character.

If the cmdline is just whitespaces or \r and \n, the loop continues
without freeing the cmdline string, so it's a leak.

Fix https://gitlab.gnome.org/GNOME/libxml2/-/issues/1009
2025-12-10 12:21:16 +00:00
Peter Fordham
76a6ba4c41 Add specific check to avoid signed integer overflow of buffer size. 2025-12-10 12:14:08 +00:00
Benjamin Gilbert
b20dfb007d meson: Fix build with Meson < 1.3
Meson before 1.3 didn't support comma-separated lists in c_std.  Just
require c11 in that case.
2025-12-10 11:49:37 +00:00
Daniel Garcia Moreno
8c5e54d5bd Fix C14N type confusion
Do not try to get nsDef with xmlDoc

Fix https://gitlab.gnome.org/GNOME/libxml2/-/issues/1016
2025-12-10 11:20:53 +00:00
Daniel Garcia Moreno
05b0c03006 Fix nokogiri tests
Use the required specific bundler and add --disable-xml2-legacy
2025-12-10 12:13:32 +01:00
Daniel Garcia Moreno
b4bc4f73fe Add email to danigm maintainer entry 2025-12-10 07:32:52 +01:00
Iván Chavero
214fb81422 Adding ichavero and danigm as maintainers
Fixes: #1023
2025-12-09 23:42:40 -06:00
Nick Wellnhofer
9c80a89af2 Remove myself as maintainer
I got the following error message after trying to remove my maintainer
entry from the DOAP file:

> Must have at least one doap:maintainer property with a gnome:userid
> property

So I'm adding the previous maintainer.
2025-12-06 19:41:11 +01:00
Nick Wellnhofer
22f9d73089 io: Handle clashing error codes on AIX
Regressed with 2c2578b6f. Fixes #999.
2025-10-15 15:42:12 +02:00
Nick Wellnhofer
870c036341 fuzz: Make fuzzy encoding match more lenient
This should account for possible iconv suffixes.
2025-10-13 22:58:38 +02:00
Nick Wellnhofer
367a283b9a tree: Undeprecate several struct members 2025-10-07 12:01:05 +02:00
Nick Wellnhofer
3a3faaa253 Document process to remove API functions in MAINTAINERS.md 2025-10-07 12:00:51 +02:00
Nick Wellnhofer
2f62ebb3a7 io: Undeprecate xmlOutputBuffer members
The public API is too buggy, so direct access to struct members is
required by projects like libxslt.
2025-09-29 11:06:07 +02:00
Nick Wellnhofer
d87d94773e Revert "globals: Don't export DllMain on Windows"
This reverts commit bd2072f8d0.

Apparently, this change would require to recompile downstream code.
2025-09-29 10:50:00 +02:00
Nick Wellnhofer
bd2072f8d0 globals: Don't export DllMain on Windows
This shouldn't be done and lld 21 warns about it:

https://github.com/msys2/MINGW-packages/issues/17820
https://github.com/msys2/MINGW-packages/issues/25716

Regressed with f05af837.
2025-09-27 19:11:16 +02:00
Nick Wellnhofer
a30a276412 valid: Undeprecate xmlValidGetPotentialChildren
Fixes #988.
2025-09-26 16:29:10 +02:00
Lars Erik Wik
c537ccf0ae Fixed compilation error on GCC versions prior to 4.5
The deprecated attribute started accepting an optional string argument
in GCC version 4.5. Compiling libxml2 with GCC versions prior to that
would cause compilation errors such as:
```
./include/libxml/xmlmemory.h:134: error: wrong number of arguments specified for 'deprecated' attribute
```

Now the string argument is omitted for older versions of GCC.

Signed-off-by: Lars Erik Wik <lars.erik.wik@northern.tech>
2025-09-25 11:29:05 +02:00
Nick Wellnhofer
da45a190f7 parser: Fix attribute normalization and standalone check
Regressed with e4cbc295.
2025-09-19 13:41:17 +02:00
Nick Wellnhofer
dc307e31fd meson: Fix install dir of man pages
Regressed when reworking documentation in 2.15.

Fixes #985.
2025-09-17 11:10:51 +02:00
Nick Wellnhofer
48df82f6ea Bump version to 2.16.0 2025-09-15 13:57:30 +02:00
Nick Wellnhofer
0bea77c828 Release v2.15.0 v2.15.0 2025-09-15 13:34:13 +02:00