Commit Graph

4510 Commits

Author SHA1 Message Date
Thomas A
d4f2967c8c Update CMake Version To 3.13 2023-07-26 10:38:28 -07:00
CuriousTommy
a8fa5a946b
Merge pull request #3 from darlinghq/fedora_38_fix
Fix Building For Fedora 38
2023-06-28 09:50:44 -07:00
Thomas A
b9207807f8 Set "incompatible-function-pointer-types" As Warning 2023-06-11 19:34:41 -07:00
Thomas A
be68ea096e Upload README.md 2023-05-05 10:22:27 -07:00
Thomas A
839e3fc2d5 Update Source To libxml2-34.10 2023-02-05 19:29:17 -08:00
Thomas A
210aee9c04 Update CMake Minimum Version To 3.10 2021-04-11 14:03:33 -07:00
Ariel Abreu
f121658e7f
Use exported_symbols_list 2020-07-29 18:49:37 -04:00
Ariel Abreu
f51b06e07b
Add some more pregenerated files
They were present in the pregenerated files, but were being gitignored (I just added them forcefully now)
2020-07-05 18:57:46 -04:00
Ariel Abreu
8150dace92
Darling build of libxml2-32.13 2020-07-01 13:46:59 -04:00
Ariel Abreu
9ea73296ce
libxml2-32.13 2020-07-01 10:58:33 -04:00
Ariel Abreu
b33af038d4
Remove macOS deployment target definitions
The deployment target is now set project-wide in the root Darling CMakeLists.txt
2020-06-12 21:16:39 -04:00
Ariel Abreu
56271855ec
Initial update to clean up include directories
"initial" because there might some additional modifications necessary later on
2020-05-14 12:57:42 -04:00
Thomas A
72df5a068c Remove redundant definitions 2020-03-30 15:44:20 -07:00
Lubos Dolezel
08e37644ba Set correct dylib version (resolves darlinghq/darling#292) 2017-04-18 21:29:48 +02:00
Lubos Dolezel
aee2e88b14 Fix build 2017-03-27 13:25:27 +02:00
Lubos Dolezel
d02b5ec6dd Merge branch 'master' of github.com:darlinghq/darling-libxml2 2017-03-27 11:14:36 +02:00
Lubos Dolezel
61cf96431a Merge branch 'using-machos-experiment' 2017-03-27 11:13:12 +02:00
Lubos Dolezel
ddddc8c71a Fat build 2017-01-28 00:19:56 +01:00
Lubos Dolezel
7f67d58106 Mach-O build 2017-01-17 17:21:03 +01:00
Andrew Hyatt
21244bc1b0 Install manpages 2017-01-17 16:42:42 +01:00
Lubos Dolezel
1e75d763f1 Fix build problem on Debian/Ubuntu 2017-01-17 16:42:42 +01:00
Lubos Dolezel
8659a7b680 Updated build file 2017-01-17 16:42:42 +01:00
Lubos Dolezel
037d92d95b Link against icucore 2017-01-17 16:42:42 +01:00
Lubos Dolezel
73406b9cac Enable ICU 2017-01-17 16:42:42 +01:00
Lubos Dolezel
febb0489da Darling build files 2017-01-17 16:42:42 +01:00
Luboš Doležel
12d561e887 Merge pull request #1 from ahyattdev/master
Install manpages
2016-11-22 23:46:27 +01:00
Andrew Hyatt
1206ba80ed Install manpages 2016-11-22 14:40:17 -08:00
Nick Wellnhofer
e905f08123 Fix more NULL pointer derefs in xpointer.c
Found with afl-fuzz.
2016-10-12 14:00:03 +02:00
Nick Wellnhofer
229d1f93ce Avoid function/data pointer conversion in xpath.c
Fixes a `-pedantic` compiler warning.
2016-10-12 13:23:16 +02:00
Nick Wellnhofer
94613f64c0 Remove unused variables 2016-10-12 13:23:08 +02:00
Nick Wellnhofer
c2545cbb6d Fix format string warnings
Also fixes bug #768199:

https://bugzilla.gnome.org/show_bug.cgi?id=768199
2016-10-12 13:22:57 +02:00
Nick Wellnhofer
c1d1f71211 Disallow namespace nodes in XPointer ranges
Namespace nodes must be copied to avoid use-after-free errors.
But they don't necessarily have a physical representation in a
document, so simply disallow them in XPointer ranges.

Found with afl-fuzz.

Fixes CVE-2016-4658.
2016-10-12 13:12:18 +02:00
Nick Wellnhofer
3f8a91036d Disallow namespace nodes in XPointer points 2016-10-12 13:12:18 +02:00
Nick Wellnhofer
9ab01a277d Fix XPointer paths beginning with range-to
The old code would invoke the broken xmlXPtrRangeToFunction. range-to
isn't really a function but a special kind of location step. Remove
this function and always handle range-to in the XPath code.

The old xmlXPtrRangeToFunction could also be abused to trigger a
use-after-free error with the potential for remote code execution.

Found with afl-fuzz.

Fixes CVE-2016-5131.
2016-10-12 13:12:18 +02:00
Nick Wellnhofer
a005199330 Fix comparison with root node in xmlXPathCmpNodes
This change has already been made in xmlXPathCmpNodesExt but not in
xmlXPathCmpNodes.
2016-10-12 13:09:21 +02:00
Alex Henrie
3169602058 Fix attribute decoding during XML schema validation
For https://bugzilla.gnome.org/show_bug.cgi?id=766834

vctxt->parserCtxt is always NULL in xmlSchemaSAXHandleStartElementNs,
so this function can't call xmlStringLenDecodeEntities to decode the
entities.
2016-08-29 11:21:08 +02:00
Nick Wellnhofer
d8083bf779 Fix NULL pointer deref in XPointer range-to
- Check for errors after evaluating first operand.
- Add sanity check for empty stack.

Found with afl-fuzz.
2016-06-25 14:24:51 +02:00
Nick Wellnhofer
1fc55ca72b Don't print generic error messages in XPath tests 2016-06-25 14:24:51 +02:00
Chun-wei Fan
d77e5fc4bc relaxng.c, xmlschemas.c: Fix build on pre-C99 compilers
Make sure that the variables are declared at the top of the block.

https://bugzilla.gnome.org/show_bug.cgi?id=767063
2016-06-23 19:02:26 +08:00
Daniel Veillard
bdec2183f3 Release of libxml2-2.9.4
* doc/xml.html libxml.spec.in: updated for the release
* doc/*: regenerated but no API additions
2016-05-23 16:04:52 +08:00
David Kilzer
502f6a6d08 More format string warnings with possible format string vulnerability
For https://bugzilla.gnome.org/show_bug.cgi?id=761029

adds a new xmlEscapeFormatString() function to escape composed format
strings
2016-05-23 15:01:08 +08:00
Daniel Veillard
bdd66182ef Avoid building recursive entities
For https://bugzilla.gnome.org/show_bug.cgi?id=762100

When we detect a recusive entity we should really not
build the associated data, moreover if someone bypass
libxml2 fatal errors and still tries to serialize a broken
entity make sure we don't risk to get ito a recursion

* parser.c: xmlParserEntityCheck() don't build if entity loop
  were found and remove the associated text content
* tree.c: xmlStringGetNodeList() avoid a potential recursion
2016-05-23 15:01:07 +08:00
Pranjal Jumde
0bcd05c5cd Heap-based buffer overread in htmlCurrentChar
For https://bugzilla.gnome.org/show_bug.cgi?id=758606

* parserInternals.c:
(xmlNextChar): Add an test to catch other issues on ctxt->input
corruption proactively.
For non-UTF-8 charsets, xmlNextChar() failed to check for the end
of the input buffer and would continuing reading.  Fix this by
pulling out the check for the end of the input buffer into common
code, and return if we reach the end of the input buffer
prematurely.
* result/HTML/758606.html: Added.
* result/HTML/758606.html.err: Added.
* result/HTML/758606.html.sax: Added.
* result/HTML/758606_2.html: Added.
* result/HTML/758606_2.html.err: Added.
* result/HTML/758606_2.html.sax: Added.
* test/HTML/758606.html: Added test case.
* test/HTML/758606_2.html: Added test case.
2016-05-23 15:01:07 +08:00
David Kilzer
0090675905 Heap-based buffer-underreads due to xmlParseName
For https://bugzilla.gnome.org/show_bug.cgi?id=759573

* parser.c:
(xmlParseElementDecl): Return early on invalid input to fix
non-minimized test case (759573-2.xml).  Otherwise the parser
gets into a bad state in SKIP(3) at the end of the function.
(xmlParseConditionalSections): Halt parsing when hitting invalid
input that would otherwise caused xmlParserHandlePEReference()
to recurse unexpectedly.  This fixes the minimized test case
(759573.xml).

* result/errors/759573-2.xml: Add.
* result/errors/759573-2.xml.err: Add.
* result/errors/759573-2.xml.str: Add.
* result/errors/759573.xml: Add.
* result/errors/759573.xml.err: Add.
* result/errors/759573.xml.str: Add.
* test/errors/759573-2.xml: Add.
* test/errors/759573.xml: Add.
2016-05-23 15:01:07 +08:00
Pranjal Jumde
38eae57111 Heap use-after-free in xmlSAX2AttributeNs
For https://bugzilla.gnome.org/show_bug.cgi?id=759020

* parser.c:
(xmlParseStartTag2): Attribute strings are only valid if the
base does not change, so add another check where the base may
change.  Make sure to set 'attvalue' to NULL after freeing it.
* result/errors/759020.xml: Added.
* result/errors/759020.xml.err: Added.
* result/errors/759020.xml.str: Added.
* test/errors/759020.xml: Added test case.
2016-05-23 15:01:07 +08:00
Pranjal Jumde
11ed4a7a90 Heap use-after-free in htmlParsePubidLiteral and htmlParseSystemiteral
For https://bugzilla.gnome.org/show_bug.cgi?id=760263

* HTMLparser.c: Add BASE_PTR convenience macro.
(htmlParseSystemLiteral): Store length and start position instead
of a pointer while iterating through the public identifier since
the underlying buffer may change, resulting in a stale pointer
being used.
(htmlParsePubidLiteral): Ditto.
2016-05-23 15:01:07 +08:00
David Kilzer
4472c3a5a5 Fix some format string warnings with possible format string vulnerability
For https://bugzilla.gnome.org/show_bug.cgi?id=761029

Decorate every method in libxml2 with the appropriate
LIBXML_ATTR_FORMAT(fmt,args) macro and add some cleanups
following the reports.
2016-05-23 15:01:07 +08:00
Hugh Davenport
beca86e8c8 Detect change of encoding when parsing HTML names
From https://bugzilla.gnome.org/show_bug.cgi?id=758518

Happens when a file has a name getting parsed, but no valid encoding
set, so libxml has to guess what the encoding is. This patch detects
when the buffer location changes, and if it does, restarts the parsing
of the name.

This slightly change a couple of regression tests output
2016-05-23 15:01:07 +08:00
Daniel Veillard
b1d34de46a Fix inappropriate fetch of entities content
For https://bugzilla.gnome.org/show_bug.cgi?id=761430

libfuzzer regression testing exposed another case where the parser would
fetch content of an external entity while not in validating mode.
Plug that hole
2016-05-23 15:01:07 +08:00
Pranjal Jumde
45752d2c33 Bug 759398: Heap use-after-free in xmlDictComputeFastKey <https://bugzilla.gnome.org/show_bug.cgi?id=759398>
* parser.c:
(xmlParseNCNameComplex): Store start position instead of a
pointer to the name since the underlying buffer may change,
resulting in a stale pointer being used.
* result/errors/759398.xml: Added.
* result/errors/759398.xml.err: Added.
* result/errors/759398.xml.str: Added.
* test/errors/759398.xml: Added test case.
2016-05-23 15:01:07 +08:00