1
0
mirror of https://gitlab.gnome.org/GNOME/libxml2.git synced 2025-01-15 23:24:06 +03:00

5838 Commits

Author SHA1 Message Date
Nick Wellnhofer
7f04e29731 xinclude: Fix regression with nested includes
This reverts commits 74dcc10b and 87d20b55.

Fixes #424.
2022-10-18 19:17:45 +02:00
Nick Wellnhofer
644a89e080 [CVE-2022-40304] Fix dict corruption caused by entity reference cycles
When an entity reference cycle is detected, the entity content is
cleared by setting its first byte to zero. But the entity content might
be allocated from a dict. In this case, the dict entry becomes corrupted
leading to all kinds of logic errors, including memory errors like
double-frees.

Stop storing entity content, orig, ExternalID and SystemID in a dict.
These values are unlikely to occur multiple times in a document, so they
shouldn't have been stored in a dict in the first place.

Thanks to Ned Williamson and Nathan Wachholz working with Google Project
Zero for the report!
2022-10-14 15:02:06 +02:00
Nick Wellnhofer
ffaec75809 Fix integer overflows with XML_PARSE_HUGE
Also impose size limits when XML_PARSE_HUGE is set. Limit size of names
to XML_MAX_TEXT_LENGTH (10 million bytes) and other content to
XML_MAX_HUGE_LENGTH (1 billion bytes).

Move some the length checks to the end of the respective loop to make
them strict.

xmlParseEntityValue didn't have a length limitation at all. But without
XML_PARSE_HUGE, this should eventually trigger an error in xmlGROW.

Thanks to Maddie Stone working with Google Project Zero for the report!
2022-10-14 15:01:46 +02:00
Nick Wellnhofer
1a2d8ddc06 parser: Fix potential memory leak in xmlParseAttValueInternal
Fix memory leak in case xmlParseAttValueInternal is called with a NULL
`len` a non-NULL `alloc` argument. This static function is never called
with such arguments internally, but the misleading code should be fixed
nevertheless.

Fixes #422.
2022-10-11 13:14:37 +02:00
Nick Wellnhofer
5bfaf23059 win32: Fix build with VS2013
Should fix #420.
2022-10-11 13:00:33 +02:00
Nick Wellnhofer
e2bae1bc04 autotools: Don't use version script on Windows
A feature test would be better, but blacklisting Windows platforms seems
good enough for now.
2022-09-20 14:39:52 +02:00
Nick Wellnhofer
796c830a2f cmake: Set SOVERSION
Fixes #410.
2022-09-20 14:30:19 +02:00
Nick Wellnhofer
1d4f5d24ac schemas: Fix null-pointer-deref in xmlSchemaCheckCOSSTDerivedOK
Found by OSS-Fuzz.
2022-09-13 16:56:59 +02:00
Nick Wellnhofer
f2392dc464 gitlab-ci: Allow cast-align warnings from clang 2022-09-09 14:03:01 +02:00
Nick Wellnhofer
a9669679f5 error: Don't use initGenericErrorDefaultFunc
The code in xmlInitParser did only set the error handler if it was NULL
which should never happen.
2022-09-09 13:52:48 +02:00
Nick Wellnhofer
27c8ba6054 xpath: Lower XPath recursion limit on Windows 2022-09-07 22:34:42 +02:00
Nick Wellnhofer
f597eff8dd autotools: Fix winsock detection
Hardcode the required library on MinGW because winsock uses non-standard
calling conventions on 32-bit Windows which makes AC_SEARCH_LIBS fail.

Should fix #406.
2022-09-07 18:26:44 +02:00
Nick Wellnhofer
16d3e8b239 autotools: Only add network libraries if HTTP/FTP enabled 2022-09-07 18:10:03 +02:00
Nick Wellnhofer
ae98a5b47e gitlab-ci: Fix tar invocation 2022-09-07 12:12:45 +02:00
Nick Wellnhofer
c52dd49473 gitlab-ci: Move MSVC test to separate script 2022-09-06 23:27:01 +02:00
Nick Wellnhofer
ea78427dca gitlab-ci: Fix SUFFIX, remove MINGW_PATH 2022-09-06 22:46:07 +02:00
Nick Wellnhofer
e4bdbf3ddb gitlab-ci: Consolidate CMake test scripts 2022-09-06 21:37:17 +02:00
Nick Wellnhofer
861466bf4e gitlab-ci: Only install MinGW autotools if needed 2022-09-06 20:32:08 +02:00
Nick Wellnhofer
5ff3baf0dc python: Create .pyd on Windows 2022-09-06 19:33:32 +02:00
Nick Wellnhofer
e86ede09d4 gitlab-ci: Only install cmake MinGW package if needed
On MinGW, cmake requires curl which requires nghttp2 which requires
libxml2. But having a system libxml2 interferes with the Python tests
for now. Ultimately, we should use Python's os.add_dll_directory() on
Windows. I'm not sure why the current solution using PATH even works.
2022-09-06 19:33:32 +02:00
Nick Wellnhofer
7ab3228f21 gitlab-ci: Install 7-Zip using the .msi
So we don't need cmake to extract a file.
2022-09-06 19:33:32 +02:00
Nick Wellnhofer
fec85df14d xmllint: Document --quiet option 2022-09-06 19:33:32 +02:00
Nick Wellnhofer
ea8f7c92a9 autotools: Disable parallel Python build
Makefile rules with multiple output files don't work reliably with
parallel builds. There are several ways to fix this issue with GNU Make,
but they aren't portable. I'd be really interested in a totally
reliable, cross-platform solution to this problem.

.NOTPARALLEL is also understood by BSD make, at least.
2022-09-06 01:07:24 +02:00
Nick Wellnhofer
9d19c169bb python: Don't output missing generators during build 2022-09-06 01:07:24 +02:00
Nick Wellnhofer
a41878bd4c build: Remove check for broken ss_family
This only seemed to affect ancient AIX systems.
2022-09-06 01:07:24 +02:00
Nick Wellnhofer
c63b2692c9 gitlab-ci: Disable MSan for now
MSan seems broken on Ubuntu 22.04.
2022-09-05 22:50:45 +02:00
Nick Wellnhofer
ad33845975 autotools: Fix bug with multiline arguments
Should fix #404.
2022-09-05 21:16:20 +02:00
Nick Wellnhofer
adcf399beb autotools: Try to fix bug with multiline arguments
Only happens with older autoconf?
2022-09-05 15:36:13 +02:00
Nick Wellnhofer
30c8d9bb23 http: Simplify IPv6 checks
This should also enable IPv6 support on Windows. Untested and mostly
useless anyway, since we don't support HTTPS.
2022-09-05 02:26:13 +02:00
Nick Wellnhofer
9e5a016ef0 autotools: Fix network checks on Windows 2022-09-05 01:25:35 +02:00
Nick Wellnhofer
98acf28f71 Use $MSYSTEM and 'bash -lc' in MinGW CI
Setting the $MSYSTEM environment variable and invoking shell scripts
with 'bash -lc' sets up the correct MinGW environment.

See https://www.msys2.org/docs/ci/
2022-09-04 22:42:46 +02:00
Nick Wellnhofer
5d32b12645 Fix detection of GNU libiconv
GNU libiconv prefixes symbols with "lib".
2022-09-04 22:05:16 +02:00
Nick Wellnhofer
460ba0cb7e Add CI job for MinGW/Autotools 2022-09-04 22:00:57 +02:00
Nick Wellnhofer
0cc9c1d1b7 Consolidate CI scripts 2022-09-04 20:27:27 +02:00
Nick Wellnhofer
89aeb4df44 Allow empty MINGW_PACKAGE_PREFIX 2022-09-04 20:27:27 +02:00
Nick Wellnhofer
efc0e85c02 Move Dockerfile to .gitlab-ci directory 2022-09-04 20:27:27 +02:00
Nick Wellnhofer
02e1237196 cmake: Fix Python installation
Don't install into ${Python_SITEARCH} for now.
2022-09-04 20:27:27 +02:00
Nick Wellnhofer
243fdbc31c cmake: Don't check for Python 2 2022-09-04 20:27:27 +02:00
Nick Wellnhofer
b0556e1449 testapi: Disable on Windows for now
It's incredibly slow for some reason.
2022-09-04 20:27:21 +02:00
Nick Wellnhofer
27b2b86417 configure.ac: Also check for MSYS host 2022-09-04 18:36:04 +02:00
Nick Wellnhofer
3a1c5ee7c1 Disable fuzzer tests if glob.h wasn't found 2022-09-04 18:36:04 +02:00
Nick Wellnhofer
ad6f10a81b Fix Python build on Windows
Build Python bindings with -no-undefined on Windows. Remove libs that
should already be set by PKG_CHECK_MODULE.
2022-09-04 18:36:04 +02:00
Nick Wellnhofer
22b82d14d1 Improve network library detection 2022-09-04 18:36:04 +02:00
Nick Wellnhofer
0d90125859 Fix Windows compiler warnings in python/types.c 2022-09-04 18:36:04 +02:00
Nick Wellnhofer
71736b4e9a Fix libxml_PyFileGet
Broken in commit 75cdb6dd.
2022-09-04 18:36:04 +02:00
Nick Wellnhofer
f9fcb2c47a Revert "CI job for MingW64/Autotools"
This reverts commit 6bfebf4d5886bd5f2a3979ceedc27ebd6c3c5009.
2022-09-04 04:47:48 +02:00
Nick Wellnhofer
6bfebf4d58 CI job for MingW64/Autotools 2022-09-04 04:04:45 +02:00
Nick Wellnhofer
0048fd0a50 Detect ws2_32 with AC_SEARCH_LIBS 2022-09-04 03:57:09 +02:00
Nick Wellnhofer
60b03c9ec9 Rework network configure checks
Migrate to AC_SEARCH_LIBS. Don't pollute LIBS.
2022-09-04 03:47:09 +02:00
Nick Wellnhofer
fe02289fa5 Remove arg cast configure checks
We can simply cast to non-const char * unconditionally.
2022-09-04 03:19:01 +02:00