1
0
mirror of https://gitlab.gnome.org/GNOME/libxml2.git synced 2025-01-20 14:03:33 +03:00

5209 Commits

Author SHA1 Message Date
Nick Wellnhofer
2489c1d024 Remove useless __CYGWIN__ checks
From what I can tell, some really early Cygwin versions from around
1998-2000 used to erroneously define _WIN32. This was eventually fixed,
but these days, the `defined(_WIN32) && !defined(__CYGWIN__)` idiom is
unnecessary.

Now, we only check for __CYGWIN__ in xmlexports.h when deciding whether
to use __declspec.
2022-02-28 22:58:35 +01:00
Nick Wellnhofer
ea6e8f998d Fix certain combinations of regex range quantifiers
Fix regex transitions that have both min/max and a counter. In this
case, we want to save the regex state before incrementing the counter.

Fixes #301 and the issue reported here:

https://mail.gnome.org/archives/xml/2016-April/msg00017.html
2022-02-28 16:56:02 +01:00
Nick Wellnhofer
382fb056b5 Fix range quantifier on subregex
Make sure to add counted exit transitions before other counter
transitions. Otherwise, we won't backtrack correctly.

Fixes #65.
2022-02-28 16:56:02 +01:00
Mike Dalessio
48ed5a74bd Update xmlStrlen() to use POSIX / ISO C strlen()
This should be faster on a wide range of platforms.

Closes #212
2022-02-26 16:20:32 +00:00
Nick Wellnhofer
5bc5f0762f Fix build with older Python versions
ModuleNotFoundError is only available since Python 3.6. Use the
superclass ImportError instead. Fixes commit 3cc64a89.

Fixes #347.
2022-02-24 18:41:23 +01:00
Nick Wellnhofer
c41bc10da3 Fix unused variable warnings with disabled features 2022-02-22 19:57:12 +01:00
Nick Wellnhofer
4fd69f3e27 Fix recovery from invalid HTML start tags
Only try to parse a start tag if there's a '<' followed by an ASCII
letter. This is more in line with HTML5 and the old behavior in
recovery mode. Emit a literal '<' if the following character is
invalid.

Fixes #101.
Fixes #339.
2022-02-22 18:41:00 +01:00
Nick Wellnhofer
b057239b3f More fixes to --without-valid build
Fix runtest and Python bindings when building --without-valid.

The Python tests still fail. There doesn't seem to be a mechanism to
disable tests depending on feature flags.
2022-02-22 11:52:38 +01:00
Nick Wellnhofer
d05317cee5 Fix --without-valid build
Regressed in commit 652dd12a.
2022-02-22 11:51:08 +01:00
Nick Wellnhofer
f550977295 Fix documentation in entities.c 2022-02-20 22:06:16 +01:00
Nick Wellnhofer
b26d581d66 Add note about optimization flags 2022-02-20 21:49:05 +01:00
Nick Wellnhofer
6117700e2c Remove special configuration for certain maintainers 2022-02-20 21:49:05 +01:00
Nick Wellnhofer
004fe9de53 Deprecate IDREF-related functions in valid.h
These functions are only needed internally for validation.

xmlGetRefs is inherently unsafe because the ref table isn't updated
if attributes are removed (unlike the ids table).

None of the Ubuntu 20.04 packages depending on libxml2 use any of these
functions (except xmlFreeRefTable in libxslt), so it seems perfectly
safe to deprecate them.

Remove xmlIsRef and xmlRemoveRef from the Python bindings.
2022-02-20 21:49:05 +01:00
Nick Wellnhofer
61de92979b Deprecate all functions in DOCBparser.h 2022-02-20 21:49:05 +01:00
Nick Wellnhofer
aeaf02c0a3 Disable docbook support by default
The docbook code is broken and has been deprecated for years.
2022-02-20 21:49:04 +01:00
Nick Wellnhofer
cf4893f7b3 Deprecate legacy functions 2022-02-20 21:49:04 +01:00
Nick Wellnhofer
96889d195b Disable legacy support by default
If you need support for legacy APIs, you have to enable it explicitly:

    ./configure --with-legacy
2022-02-20 21:49:04 +01:00
Nick Wellnhofer
9e0ca5a19f Deprecate all functions in nanoftp.h 2022-02-20 21:49:04 +01:00
Nick Wellnhofer
a0a0f3be93 Disable FTP support by default
In the unlikely case that you really need FTP support, you have to
enable it explicitly with:

    ./configure --with-ftp
2022-02-20 21:49:04 +01:00
Nick Wellnhofer
a2fe74c08a Add XML_DEPRECATED macro
__attribute__((deprecated)) is available since at least GCC 3.1, so an
exact version check is probably unnecessary.
2022-02-20 21:49:04 +01:00
Nick Wellnhofer
346c3a930c Remove elfgcchack.h
The same optimization can be enabled with -fno-semantic-interposition
since GCC 5. clang has always used this option by default.
2022-02-20 21:49:04 +01:00
Nick Wellnhofer
ce0871e15c Only warn on invalid redeclarations of predefined entities
Downgrade the error message to a warning since the error was ignored,
anyway. Also print the name of redeclared entity. For a proper fix that
also shows filename and line number of the invalid redeclaration, we'd
have to

- pass the parser context to the entity functions somehow, or
- make these functions return distinct error codes.

Partial fix for #308.
2022-02-20 21:49:04 +01:00
Nick Wellnhofer
e03590c9ad Don't add IDs containing unexpanded entity references
When parsing without entity substitution, IDs or IDREFs containing
unexpanded entity reference like "abc&x;def" could be created. We could
try to expand these entities like in validation mode, but it seems
safer to honor the request not to expand entities. We silently ignore
such IDs for now.
2022-02-20 21:49:04 +01:00
Nick Wellnhofer
274a1b5bec Remove unneeded code in xmlreader.c
Now that no references to ID and IDREF attributes are stored in
streaming validation mode, there's no need to try and remove them.

Also remove xmlTextReaderFreeIDTable which was identical to
xmlFreeIDTable.
2022-02-20 21:49:04 +01:00
Nick Wellnhofer
d7cb33cf44 Rework validation context flags
Use a bitmask instead of magic values to

- keep track whether the validation context is part of a parser context
- keep track whether xmlValidateDtdFinal was called

This allows to add addtional flags later.

Note that this deliberately changes the name of a public struct member,
assuming that this was always private data never to be used by client
code.
2022-02-20 21:49:04 +01:00
Nick Wellnhofer
a075d256fd Release v2.9.13 v2.9.13 2022-02-19 19:26:42 +01:00
Nick Wellnhofer
04d4124c15 Update news and rebuild documentation 2022-02-19 19:26:42 +01:00
Nick Wellnhofer
652dd12a85 [CVE-2022-23308] Use-after-free of ID and IDREF attributes
If a document is parsed with XML_PARSE_DTDVALID and without
XML_PARSE_NOENT, the value of ID attributes has to be normalized after
potentially expanding entities in xmlRemoveID. Otherwise, later calls
to xmlGetID can return a pointer to previously freed memory.

ID attributes which are empty or contain only whitespace after
entity expansion are affected in a similar way. This is fixed by
not storing such attributes in the ID table.

The test to detect streaming mode when validating against a DTD was
broken. In connection with the defects above, this could result in a
use-after-free when using the xmlReader interface with validation.
Fix detection of streaming mode to avoid similar issues. (This changes
the expected result of a test case. But as far as I can tell, using the
XML reader with XIncludes referencing the root document never worked
properly, anyway.)

All of these issues can result in denial of service. Using xmlReader
with validation could result in disclosure of memory via the error
channel, typically stderr. The security impact of xmlGetID returning
a pointer to freed memory depends on the application. The typical use
case of calling xmlGetID on an unmodified document is not affected.
2022-02-19 19:26:42 +01:00
Nick Wellnhofer
d19bab68f4 Fix fuzz/.gitignore after fixing VPATH build 2022-02-19 19:26:42 +01:00
Nick Wellnhofer
f2ad86fa60 Remove SVN keyword anchors 2022-02-17 19:05:26 +01:00
Nick Wellnhofer
b041d829a2 Remove xmlwin32version.h
This file was undocumented and never used anywhere. Maybe users were
supposed to rename this file to xmlversion.h manually. These days, both
CMake and win32/configure.js generate xmlversion.h from xmlversion.h.in,
just like the Autotools build.
2022-02-16 19:55:30 +01:00
Nick Wellnhofer
176115c664 Fix source URL in libxml.spec.in 2022-02-14 22:49:04 +01:00
Nick Wellnhofer
8626648790 Fix fuzzer test with VPATH build
Also fixes make distcheck.
2022-02-14 18:06:38 +01:00
Nick Wellnhofer
85a35ba068 Support custom prefix when installing Python module
Also fixes make distcheck.
2022-02-14 17:44:29 +01:00
Nick Wellnhofer
4608443695 Remove Makefile.win
A Makefile for Visual C++ 5.0, last changed 23 years ago.
2022-02-14 03:45:03 +01:00
Nick Wellnhofer
a20a6022e0 Fix distribution after README change 2022-02-14 03:45:03 +01:00
Nick Wellnhofer
411f98039e Rework README
- Merge INSTALL.libxml2, CONTRIBUTING and AUTHORS into README
- Convert to Markdown
- Redact and update content
- Update links
2022-02-14 03:00:09 +01:00
Nick Wellnhofer
e16d729d9d Remove README.cvs-commits 2022-02-14 02:33:58 +01:00
Nick Wellnhofer
8eb0693746 Remove outdated ChangeLog code
The ChangeLog is from pre-Git times.
2022-02-14 01:01:23 +01:00
Nick Wellnhofer
7fe9addcbc Remove CVS and SVN-related code 2022-02-13 23:35:18 +01:00
Nick Wellnhofer
1089111142 Redirect links to xmlsoft.org
Documentation and releases are now available on gitlab.gnome.org.
2022-02-13 23:10:00 +01:00
Nick Wellnhofer
4f2693a1ef Remove README.docs
This was just a partial copy of the main README.
2022-02-13 23:10:00 +01:00
Nick Wellnhofer
4a0c0e63a3 Remove MAINTAINERS
Maintainers are listed in libxml2.doap.
2022-02-13 23:10:00 +01:00
Nick Wellnhofer
b0e6eb97d9 Remove xmltutorial.pdf
We already have an HTML version.
2022-02-13 23:10:00 +01:00
Nick Wellnhofer
daf2d9c3de Fix regression in RelaxNG pattern matching
XML_SCHEMAS_QNAME is not a string-derived type. Other types up to
XML_SCHEMAS_ENTITIES are.

Should fix #224.
2022-02-13 23:04:29 +01:00
Nick Wellnhofer
d54564ea00 Remove .travis.yml 2022-02-12 21:38:19 +01:00
Nick Wellnhofer
0a6a79b218 Try again to only build GitLab Pages on main repo 2022-02-12 21:36:27 +01:00
Nick Wellnhofer
a3aca20316 Try again to only build GitLab Pages on main repo 2022-02-12 21:33:53 +01:00
Nick Wellnhofer
15111c82c2 Only build GitLab Pages on main repo 2022-02-12 21:25:25 +01:00
Nick Wellnhofer
2017cae6df Upload documentation to GitLab pages 2022-02-12 20:04:48 +01:00