|
4bc3ebf3
|
2022-03-19T17:17:40
|
|
Fix ownership of xmlNodePtr & xmlAttrPtr fields in xmlSetTreeDoc()
When changing `doc` on an xmlNodePtr or xmlAttrPtr, certain
fields must either be a free-standing string, or they must be
owned by `doc->dict`.
The code to make this change was simply missing, so the crash
happened when an xmlAttrPtr was being torn down after `doc`
changed from non-NULL to NULL, but the `name` field was not
copied. This is scenario 1 below.
The xmlNodePtr->name and xmlNodePtr->content fields are also
fixed at the same time. Note that xmlNodePtr->content is never
added to the dictionary, so NULL is used instead of `newDict` to
force a free-standing copy.
This change covers all cases of dictionary changes:
1. Owned by old dictionary -> NULL new dictionary
- Create free-standing copy of string.
2. Owned by old dictionary -> Non-NULL new dictionary
- Get string from new dictionary pool.
3. Not owned by old dictionary -> Non-NULL new dictionary
- No action necessary (already a free-standing string).
4. Not owned by old dictionary -> NULL new dictionary
- No action necessary (already a free-standing string).
* tree.c:
(_copyStringForNewDictIfNeeded): Add.
(xmlSetTreeDoc):
- Update xmlNodePtr->name, xmlNodePtr->content and
xmlAttrPtr->name when changing the document, if needed.
Found by OSS-Fuzz Issue 45132.
|
|
0aa8652e
|
2022-05-20T14:54:49
|
|
Use xmlNewDocText in xmlXIncludeCopyRange
Otherwise, the initial node of the copy could be a text node with a
NULL document. This results in the NULL document being propagated to
copies of other nodes, losing information about the dictionary in which
node data is stored, and freeing a dict-allocated string.
See discussion in !175.
|
|
351dbdfe
|
2022-05-20T14:53:33
|
|
Disable network in API tests
Avoids hangs when trying to make network connections.
|
|
c50196c1
|
2022-04-10T20:02:47
|
|
Fix use-after-free bugs when calling xmlTextReaderClose() before xmlFreeTextReader() on post-validating parser
When creating an xmlTextReaderPtr using xmlReaderForMemory(),
there are two optional API functions that can be used:
- xmlTextReaderClose() may be called prior to calling
xmlFreeTextReader() to free parsing resources and close the
xmlTextReaderPtr without freeing it.
- xmlTextReaderCurrentDoc() may be called to return an
xmlDocPtr that's owned by the caller, and must be free using
xmlFreeDoc() after calling xmlFreeTextReader().
The use-after-free issues occur when calling
xmlTextReaderClose() before xmlFreeTextReader(), with different
issues occurring depending on whether xmlTextReaderCurrentDoc()
is also called.
* xmlreader.c:
(xmlFreeTextReader):
- Move code to xmlTextReaderClose(), remove duplicate code, and
call xmlTextReaderClose() if it hasn't been called yet.
(xmlTextReaderClose):
- Move call to xmlFreeNode(reader->faketext) from
xmlFreeTextReader() to fix a use-after-free bug when calling
xmlTextReaderClose() before xmlFreeTextReader(), but not when
using xmlTextReaderCurrentDoc(). The bug was introduced in
2002 by commit beb70bd39. In 2009 commit f4653dcd8 fixed the
use-after-free that occurred every time xmlFreeTextReader()
was called, but not the case where xmlTextReaderClose() was
called first.
- Move post-parsing validation code from xmlFreeTextReader() to
fix a second use-after-free when calling xmlTextReaderClose()
before xmlFreeTextReader(). This regressed in v2.9.10 with
commit 57a3af56f.
|
|
054e46b0
|
2022-05-14T08:48:01
|
|
Restore behavior of htmlDocContentDumpFormatOutput()
Patch by J Pascoe of Apple.
* HTMLtree.c:
(htmlDocContentDumpFormatOutput):
- Prior to commit b79ab6e6d92, xmlDoc.type was set to
XML_HTML_DOCUMENT_NODE before dumping the HTML output, then
restored before returning.
|
|
e08d8c37
|
2022-05-06T10:17:57
|
|
Add xptr_locs flag to win32/configure.js
The xptr_locs flag was added in commit 67070107 but no flag was added to
win32/configure.js, leading a compile error I had on windows where the
@WITH_XPTR_LOCS@ macro was not replaced properly on windows.
|
|
c1632fbd
|
2022-05-06T10:58:58
|
|
fix typo in comment
|
|
e9270ef0
|
2022-05-06T10:44:03
|
|
fix Schematron spelling
|
|
6c283d83
|
2022-03-08T20:10:02
|
|
[CVE-2022-29824] Fix integer overflows in xmlBuf and xmlBuffer
In several places, the code handling string buffers didn't check for
integer overflow or used wrong types for buffer sizes. This could
result in out-of-bounds writes or other memory errors when working on
large, multi-gigabyte buffers.
Thanks to Felix Wilhelm for the report.
|
|
433b3186
|
2022-04-27T12:39:12
|
|
Define LFS macros before including system headers
xmlstring.h includes stdarg.h, so it must be included after defining
macros like _FILE_OFFSET_BITS.
|
|
14517012
|
2022-04-23T19:19:33
|
|
Fix parsing of subtracted regex character classes
Fixes #370.
|
|
d9e1198c
|
2022-04-23T18:42:35
|
|
Redirect examples test output to /dev/null
Regressed in commit c61e1273.
|
|
d314046f
|
2022-04-23T17:41:44
|
|
Don't try to copy children of entity references
This would result in an error, aborting the whole copy operation.
Regressed in commit 7618a3b1.
Fixes #371.
|
|
0c0f2a57
|
2022-04-21T07:51:23
|
|
Port genUnicode.py to Python 3
|
|
b31e07db
|
2022-04-22T20:14:05
|
|
testapi: remove leading slash from "/missing.xml"
Fixes an error when running tests in a sandbox on Gentoo Linux.
Bug: https://bugs.gentoo.org/839804
|
|
65b01647
|
2022-04-21T06:27:33
|
|
Build Autotools CI tests out of source tree (VPATH)
|
|
ad098030
|
2022-04-21T06:23:55
|
|
Add --with-minimum build to CI tests
|
|
c61e1273
|
2022-04-21T06:03:22
|
|
Fix warnings when testing --with-minimum build
There's no simple way to make the doc/examples tests handle different
configurations. But these tests aren't especially valuable, so remove
the result file checks.
|
|
4612ce30
|
2022-04-21T03:52:52
|
|
Implement xpath1() XPointer scheme
See https://www.w3.org/2005/04/xpointer-schemes/
|
|
67070107
|
2022-04-20T23:17:14
|
|
Add configuration flag for XPointer locations support
Add a new configuration flag that controls whether the outdated support
for XPointer locations (ranges and points) is enabled.
--with-xptr-locs # Autotools
LIBXML2_WITH_XPTR_LOCS # CMake
The latest spec for what it essentially an XPath extension seems to be
this working draft from 2002:
https://www.w3.org/TR/xptr-xpointer/
The xpointer() scheme is listed as "being reviewed" in the XPointer
registry since at least 2006. libxml2 seems to be the only modern
software that tries to implement this spec, but the code has many bugs
and quality issues.
The flag defaults to "off" and support for this extensions has to be
requested explicitly. The relevant API functions are deprecated.
|
|
9a0be0dc
|
2022-04-21T01:11:35
|
|
Regenerate api.xml and testapi.c
|
|
343fc142
|
2022-04-21T00:45:58
|
|
Port gentest.py to Python 3
|
|
02709d0f
|
2022-04-20T19:18:17
|
|
Remove remaining definitions of STDC_HEADERS
Sync with Autotools build.
|
|
270eb712
|
2022-04-20T14:04:04
|
|
cmake: Run all tests when threads are disabled
|
|
18bcced9
|
2022-04-20T13:36:02
|
|
cmake: Fix build with thread support
Move configure_file(config.h) below pthreads check.
Fix regression caused by commit f5659a1.
|
|
dbc23ed3
|
2022-04-13T17:02:50
|
|
Also build CI tests with -Werror
|
|
7204dbb0
|
2022-04-13T16:51:49
|
|
Don't mix declarations and code in runtest.c
|
|
776b0028
|
2022-04-13T16:46:58
|
|
cmake: Disable FTP and legacy modules by default
Sync with Autotools build.
|
|
e13c8081
|
2022-04-13T16:45:57
|
|
Run CI tests with FTP and legacy modules
These modules are disabled by default. Enable them when testing.
|
|
cacf6555
|
2022-04-13T16:43:15
|
|
Fix compiler warnings in Python code
Add more deprecated functions to avoid compiler warnings when building
the Python bindings.
|
|
f5659a12
|
2022-04-13T14:30:54
|
|
cmake: Fix build without thread support
Only check for pthread.h if threads are enabled.
Fixes #367.
|
|
44e9118c
|
2022-04-08T12:33:17
|
|
Prevent integer-overflow in htmlSkipBlankChars() and xmlSkipBlankChars()
* HTMLparser.c:
(htmlSkipBlankChars):
* parser.c:
(xmlSkipBlankChars):
- Cap the return value at INT_MAX.
- The commit range that OSS-Fuzz listed for the fix didn't make
any changes to xmlSkipBlankChars(), so it seems like this
issue may still exist.
Found by OSS-Fuzz Issue 44803.
|
|
a15f2abe
|
2022-04-08T12:16:51
|
|
Use UPDATE_COMPAT() consistently in buf.c
* buf.c:
(xmlBufCreate):
(xmlBufCreateSize):
(xmlBufDetach):
(xmlBufCreateStatic):
(xmlBufFromBuffer):
|
|
41afa89f
|
2022-04-10T14:09:29
|
|
Fix short-lived regression in xmlStaticCopyNode
Commit 7618a3b1 didn't account for coalesced text nodes.
I think it would be better if xmlStaticCopyNode didn't try to coalesce
text nodes at all. This code path can only be triggered if some other
code doesn't coalesce text nodes properly. In this case, OSS-Fuzz found
such behavior in xinclude.c.
|
|
a5724a3b
|
2022-04-08T15:46:26
|
|
cmake: Install documentation in CMAKE_INSTALL_DOCDIR
Sync with recent Autotools change.
|
|
4d98f6f9
|
2022-04-08T12:11:39
|
|
cmake: Remove more unnecessary files installed in docs dir
Sync with commit 95766541622b3a66c929e2e272b0252750d0174d
Don't install man pages in docs directory, these are already installed
in the correct path and while at it sort list
|
|
21561e83
|
2016-05-20T15:21:43
|
|
Mark more static data as `const`
Similar to 8f5710379, mark more static data structures with
`const` keyword.
Also fix placement of `const` in encoding.c.
Original patch by Sarah Wilkin.
|
|
b7e8e4c7
|
2022-04-06T18:05:20
|
|
Fix leak of xmlElementContent
* valid.c:
(xmlCopyDocElementContent):
- Set `tmp->parent` properly to fix a leak that occurs in
xmlFreeDocElementContent().
- Appears to be a regresion from cee2b3a5f1.
Found by OSS-Fuzz Issue 44509.
|
|
94ac5e61
|
2022-04-07T02:05:41
|
|
CMakeLists.txt: Fix LIBXML_VERSION_NUMBER
Also fix LIBXML_VERSION and remove LIBXML_VERSION_STRING.
Fixes #365.
|
|
a62b31f4
|
2022-04-06T19:57:30
|
|
Use portable python shebangs
* In conda or Gentoo Prefix, we don't want to use the system python and
instead rely on PATH lookup.
|
|
f2987a29
|
2022-04-03T18:49:19
|
|
cmake: Remove non needed files in docs dir
Don't install files that are used to generate the documentation
|
|
e59aa6ca
|
2022-04-04T05:57:07
|
|
Move doc/examples tests to new test suite
|
|
3f74e42b
|
2022-04-04T05:19:33
|
|
Simplify 'make check' targets
|
|
f60e2193
|
2022-04-03T21:24:21
|
|
configure: move XML_PRIVATE_LIBS after WIN32_EXTRA_LIBADD is set
currently the pkg-config file lacks -lws2_32 because WIN32_EXTRA_LIBADD
isn't set by the time XML_PRIVATE_LIBS is set
Signed-off-by: Christopher Degawa <ccom@randomderp.com>
|
|
48f191e7
|
2022-04-04T03:12:49
|
|
Fix schemas and relaxng tests
Run all tests in runtest.c with warnings. This is required to match the
schema validation output from xmllint and doesn't seem to cause any
problems.
Fix the .xml file pattern.
Check parser errors. Print xmllint message if Relax-NG schema can't be
parsed.
|
|
4de7f2ac
|
2022-04-04T03:28:21
|
|
Remove unused result files
|
|
5ce893c0
|
2020-07-09T03:21:07
|
|
Move regexp tests to runtest
|
|
f1c32b4c
|
2020-07-09T03:19:13
|
|
Allow missing result files in runtest
Treat missing files as empty.
|
|
95c7f315
|
2022-04-03T21:39:14
|
|
Move SVG tests to runtest.c
Also update the test results for the first time since 2000.
|
|
0cca7b51
|
2022-04-03T21:29:58
|
|
Move testModule to new test suite
Invoke testModule when the modern test suite is run with 'make check'.
|
|
f23ca9f9
|
2022-04-03T21:25:54
|
|
Move testThreads to new test suite
Invoke testThreads when the modern test suite is run with 'make check'.
|
|
48b03c84
|
2022-04-03T20:36:38
|
|
Remove major parts of old test suite
Remove all the parts of the old test suite which are covered by
runtest.c for quite some time.
The following test programs are removed:
- testC14N
- testHTML
- testReader
- testRelax
- testSAX
- testSchemas
- testURI
- testXPath
This also removes a few results of unimportant tests only run by the old
test suite.
|
|
0d467de2
|
2022-04-03T19:11:13
|
|
Move local Autoconf macros into m4 directory
|
|
4b10e7cf
|
2022-04-03T18:44:37
|
|
Remove outdated xml2Conf.sh
|
|
bf2436ac
|
2022-04-03T19:02:06
|
|
Update xml2-config man page
|
|
61b78b0a
|
2022-04-03T18:30:26
|
|
Consolidate man pages
Move xml2-config.1 into doc directory. Remove outdated libxml.3.
|
|
41a19430
|
2022-04-03T17:54:23
|
|
Make testchar return an error on failure
|
|
0e9776b0
|
2022-04-03T17:09:50
|
|
Initialize XPath floating-point globals
Should fix #138.
|
|
f0ba4da1
|
2022-04-03T14:30:03
|
|
Add CI job for static build
|
|
a340d8b1
|
2022-04-03T02:20:04
|
|
Use XML_PRIVATE_LIBS in libxml2_la_LIBADD
After this change, variables Z_LIBS, LZMA_LIBS, ICU_LIBS, ICONV_LIBS
and WIN32_EXTRA_LIBADD are unused outside of configure.ac. We keep
exporting them with AC_SUBST for now.
|
|
5cae1a14
|
2022-04-03T02:20:59
|
|
Update libxml-2.0-uninstalled.pc.in
|
|
1db151ac
|
2022-04-03T14:36:03
|
|
Remove LIBS from XML_PRIVATE_LIBS
|
|
cf6cd81c
|
2022-04-03T02:18:25
|
|
Add WIN32_EXTRA_LIBADD to XML_PRIVATE_LIBS
|
|
7016b0e0
|
2022-04-03T01:42:17
|
|
Don't overlink executables
With very few exceptions, utilities and test programs don't require any
external libraries.
- xmllint and xmlcatalog need libreadline
- runtest and testThreads need pthreads
|
|
6d10df7c
|
2022-04-02T22:23:44
|
|
cmake: Adjust paths for UNIX or UNIX-like target systems
Sync paths with GNU Autotools
|
|
141d784e
|
2022-04-02T21:06:47
|
|
build: Make use of variables in libxml's pkg-config file
Instead of hardcoding make use of available variables and optimize usage
|
|
d47c52ac
|
2022-04-02T19:21:02
|
|
Avoid obsolescent `test -a` constructs
* POSIX calls the `-a` operator obsolescent and strongly discourages
its use, instead recommending chaining `test` calls instead:
https://pubs.opengroup.org/onlinepubs/9699919799/utilities/test.html
|
|
7618a3b1
|
2022-02-06T21:11:38
|
|
Make xmlStaticCopyNode non-recursive
|
|
aab584dc
|
2022-03-06T23:23:43
|
|
Clean up encoding switching code
- Remove xmlSwitchToEncodingInt which was basically just a wrapper
around xmlSwitchInputEncodingInt.
- Simplify xmlSwitchEncoding.
- Improve error handling in xmlSwitchInputEncodingInt.
- Deprecate xmlSwitchInputEncoding.
|
|
c8ccb727
|
2022-04-02T18:03:44
|
|
Move AM_MAINTAINER_MODE to AM section
|
|
0f04d5a1
|
2022-01-18T14:22:24
|
|
configure: check for icu DEFS
In some cases we need to add additional defs to build against icu if
icu has certain options configured.
ICU warns about this when building:
*** WARNING: You must set the following flags before code compiled against this ICU will function properly:
-DU_DISABLE_RENAMING=1
We can fetch these flags from the icu pkgconfig and add them if
required.
This fixes symbol errors if ICU is built without renaming.
Signed-off-by: James Hilliard <james.hilliard1@gmail.com>
|
|
5ccdfa43
|
2022-04-02T16:54:30
|
|
configure.ac: produce tar.xz only (GNOME policy)
* This is part of a policy from 2011:
https://mail.gnome.org/archives/distributor-list/2011-September/msg00000.html
|
|
7bce3008
|
2022-04-02T16:54:29
|
|
configure.ac: make AM_SILENT_RULES([yes]) unconditional
* No need to support Automake 1.10 anymore.
|
|
c2ee4a20
|
2022-04-02T16:55:18
|
|
Fix GitLab pages job
|
|
e1637646
|
2022-04-02T16:42:33
|
|
Rename xmlcatalog_man.xml
|
|
207b10cf
|
2022-04-02T16:39:44
|
|
Streamline documentation installation
Use Automake variables to install and distribute files. Remove
check-extra-dist.
|
|
1366c569
|
2022-04-02T15:36:22
|
|
Don't try to recreate COPYING symlink
Since automake is initialized with "foreign" for quite some while,
it shouldn't touch these files anymore.
|
|
b7b29df9
|
2022-03-29T16:07:51
|
|
Add windows includes to xmlIO.c
xmlIO.c calls read() and getcwd() which need io.h and direct.h
respectively when compiling on windows. Otherwise, a compiler error may
be raised saying that read() and getcwd() were used implicitly.
This was regressed recently, I'm guessing it was due to the changes to
win32config.h in commit 84085a26
|
|
0137d987
|
2022-03-30T22:00:50
|
|
python/tests: open() relative to test scripts
|
|
5c71ada8
|
2022-03-30T16:51:17
|
|
Detect libm using libtool's macros
|
|
dff68688
|
2022-03-30T16:51:16
|
|
configure.ac: disable static libraries by default
|
|
438209f3
|
2022-03-30T16:51:15
|
|
python/Makefile.am: nest python docs in $(docdir)
|
|
9e304353
|
2022-03-30T16:51:14
|
|
python/Makefile.am: rely on global AM_INIT_AUTOMAKE
* Even Debian oldoldstable has Automake 1.15 available nowadays.
|
|
54e3f74b
|
2022-03-30T16:51:13
|
|
Makefile.am: install examples more idiomatically
|
|
7a4037be
|
2022-03-30T16:51:12
|
|
configure.ac: remove useless AC_SUBST
* CPPFLAGS/LDFLAGS are always substituted
|
|
865520f0
|
2022-03-30T00:32:35
|
|
Respect `--sysconfdir` in source files
* Prefix installations need to point to a non-root `etc`
- Gentoo Prefix has been patching this for over 10 years:
https://bugs.gentoo.org/317891
- MacPorts has to manually replace paths after patching:
https://github.com/macports/macports-ports/blob/cc3bb736e906abe73b014da02a89ae2b70ef6295/textproc/libxml2/Portfile#L46
|
|
74263eff
|
2022-03-30T06:02:31
|
|
fix: xmlXPathParserContext could be double-delete in OOM case.
|
|
e05491ae
|
2022-03-18T19:24:22
|
|
Ignore configure backup file created by recent autoreconf too
There is currently no way to disable the generation of this annoying
file, see https://savannah.gnu.org/support/?110417, so just ignore it.
|
|
95766541
|
2022-03-02T19:01:16
|
|
Only install *.html and *.c example files
|
|
456a0bf6
|
2022-03-02T18:58:17
|
|
Remove --with-html-dir option
Install documentation in $(docdir).
|
|
74580967
|
2022-03-02T18:45:39
|
|
Rework documentation build system
Since several generated files are under version control, their
timestamps are essentially random and rebuilding documentation using
Makefile rules can't work reliably. Simply add a phony rebuild target
that regenerates the whole documentation and other files
unconditionally.
make -C doc rebuild
|
|
fb358884
|
2022-03-02T17:35:12
|
|
Remove old website
|
|
991a9fc2
|
2022-03-29T16:20:28
|
|
Mark docbook symbols as removed
|
|
649ddb4b
|
2022-03-29T15:55:51
|
|
Port some test scripts to Python 3
|
|
92bff866
|
2022-03-29T14:18:31
|
|
Fix calls to deprecated init/cleanup functions
Only use xmlInitParser/xmlCleanupParser.
|
|
d9335077
|
2022-03-29T13:37:16
|
|
Use AM_PATH_PYTHON/PKG_CHECK_MODULES for python bindings
* `AM_PATH_PYTHON` is a much more common idiom for building
and installing python modules than writing your own.
* It also makes cross-compiling the python bindings possible.
Previously the `PYTHON_CFLAGS`/`PYTHON_LIBS` would have been
based on the `--build` python and not the `--host` python.
By using `pkg-config`, we can always redirect the python-X.Y.pc.
Bug: https://bugs.gentoo.org/582130
|
|
96849544
|
2022-03-22T19:10:51
|
|
Revert "Continue to parse entity refs in recovery mode"
This reverts commit 84823b86344fb530790a8787b80abf62715ea885 which
exposed several other, potentially serious bugs.
Fixes #356.
|
|
83d5a87e
|
2022-03-18T15:46:30
|
|
Revert "Simplify recursive pthread mutex"
This reverts commit 5ffe2981b7d0547dd957a61ac6e1e3db829748d1.
This reverts commit 4adb7677635b2c8d764767f6b484de1b26217f5d.
Recursive mutexes are an XSI extension, so better not rely on them.
|
|
2070ade6
|
2022-03-06T23:19:04
|
|
Undeprecate schema init functions
These functions aren't called from xmlInitParser, so it's better to keep
them public for now.
|
|
8d06ccd4
|
2022-03-09T22:36:51
|
|
Fix --without-debug build
Broken in commit 2cc93f77.
Fixes #354.
|