1
0
mirror of https://gitlab.gnome.org/GNOME/libxml2.git synced 2024-10-26 20:25:14 +03:00
Commit Graph

4426 Commits

Author SHA1 Message Date
Patrick Monnerat
d76abc7bcd os400: compile and install program xmlcatalog (qshell-only). 2016-05-01 18:34:41 +08:00
Patrick Monnerat
2137326eda xmlcatalog: flush stdout before interactive shell input. 2016-05-01 18:34:13 +08:00
Patrick Monnerat
cad1634ef4 os400: expand tabs in sources, strip trailing blanks. 2016-05-01 18:33:49 +08:00
Patrick Monnerat
26db5e7a55 os400: implement CL command XMLLINT. 2016-05-01 18:33:26 +08:00
Patrick Monnerat
b1682bdb93 os400: compile and install program xmllint (qshell-only). 2016-05-01 18:33:01 +08:00
Patrick Monnerat
1463a91df5 os400: initscript make_module(): Use options instead of positional parameters. 2016-05-01 18:32:20 +08:00
Patrick Monnerat
11e805d397 xmllint: flush stdout before interactive shell input. 2016-05-01 18:31:57 +08:00
Patrick Monnerat
44e49f47e8 os400: c14n.rpgle: allow *omit for nullable reference parameters. 2016-05-01 18:19:36 +08:00
Patrick Monnerat
ae0b224090 os400: use like() for double type. 2016-05-01 18:19:06 +08:00
Patrick Monnerat
155faa5221 os400: use like() for int type. 2016-05-01 18:18:38 +08:00
Patrick Monnerat
26202cf90f os400: use like() for unsigned int type. 2016-05-01 18:18:11 +08:00
Patrick Monnerat
91e2e698fd os400: use like() for enum types. 2016-05-01 18:17:12 +08:00
Baruch Siach
2e354d7432 Add xz to xml2-config --libs output
XML_LIBS should include LZMA_LIBS. This ensures that 'xml2-config --libs'
shows -llzma when xz is enabled. Otherwise static link fails because of
missing xz symbols.
2016-04-28 15:13:56 +08:00
Nick Wellnhofer
839689a9a8 Don't recurse into OP_VALUEs in xmlXPathOptimizeExpression
The ch1 slot of OP_VALUEs contains an invalid value. Ignore it.

Fixes bug #760325:

https://bugzilla.gnome.org/show_bug.cgi?id=760325
2016-04-27 18:05:06 +02:00
Nick Wellnhofer
f39fd66ea7 Fix namespace::node() XPath expression
Make sure that xmlXPathNodeSetAddNs is called for namespace nodes when
matched with a namespace::node() step. This correctly sets the parent
of namespace nodes. Note that xmlXPathNodeSetAddNs must only be called
if working on the namespace axis. Otherwise, the context node is not
the parent of the namespace node and the standard XP_TEST_HIT macro
must be invoked. This explains the errors in the C14N tests that the
old TODO comment mentioned.
2016-04-27 11:21:35 +02:00
Nick Wellnhofer
91ac664f4b Fix OOB write in xmlXPathEmptyNodeSet
xmlXPathEmptyNodeSet would write a NULL pointer just beyond the end of
the nodeTab array. This macro isn't used in libxml2, but in some of the
math functions in libexslt where it can result in heap corruption and
denial of service.

Found by afl-fuzz and ASan.
2016-04-26 16:38:08 +02:00
Nick Wellnhofer
e289390362 Fix parsing of NCNames in XPath
The NCName parser would allow any NameChar as start character. For
example, the following XPath expressions would compile:

    self::-abc
    self::0abc
    self::.abc
2016-04-23 19:12:47 +02:00
Nick Wellnhofer
96a5c17ee1 Fix OOB read with invalid UTF-8 in xmlUTF8Strsize
With certain invalid UTF-8, xmlUTF8Strsize can read up to 6 bytes
beyond the end of the string and return the wrong size.

This means that in xmlUTF8Strndup and similar code, some content behind
the string is copied. But since the terminating \0 is copied as well,
this probably can't be exploited to leak sensitive information.

Found by afl-fuzz and ASan.
2016-04-23 18:44:27 +02:00
Audric Schiltknecht
cad102b861 Do normalize string-based datatype value in RelaxNG facet checking
Original patch is from Jan Pokorný <jpokorny redhat com>
https://mail.gnome.org/archives/xml/2013-November/msg00028.html

Improve it according to reviews and add test files.
2016-04-15 22:41:24 +08:00
Jan Pokorný
27aae65156 Fix typo: s{ ec -> cr }cipt
Signed-off-by: Jan Pokorný <jpokorny@redhat.com>
2016-04-15 22:22:52 +08:00
Jan Pokorný
bb654feb9a Fix typos: dictio{ nn -> n }ar{y,ies}
Signed-off-by: Jan Pokorný <jpokorny@redhat.com>
2016-04-15 22:22:48 +08:00
Jan Pokorný
9811ce7864 Fix typos: PATH_{ SEAPARATOR -> SEPARATOR }
Signed-off-by: Jan Pokorný <jpokorny@redhat.com>
2016-04-15 22:22:43 +08:00
Shlomi Fish
d5bd2a9a40 Correct a typo. 2016-04-11 09:42:23 +08:00
David Kilzer
c5ddd09537 Bug 760921: REGRESSION (8eb55d78): doc/examples/io1 test fails after fix for "xmlSaveUri() incorrectly recomposes URIs with rootless paths" <https://bugzilla.gnome.org/show_bug.cgi?id=760921>
* doc/examples/io1.res: Update expected result.
2016-04-08 10:33:30 +08:00
David Kilzer
5be1a6e8e0 Bug 760861: REGRESSION (bf9c1dad): Missing results for test/schemas/regexp-char-ref_[01].xsd <https://bugzilla.gnome.org/show_bug.cgi?id=760861>
Add missing test results to fix the following errors when
running "make Schemastests":

    ## Schemas regression tests
    diff: ./result/schemas/regexp-char-ref_0_0.err: No such file or directory
    diff: ./result/schemas/regexp-char-ref_1_0.err: No such file or directory

* result/schemas/regexp-char-ref_0_0.err: Added.
* result/schemas/regexp-char-ref_1_0.err: Added.
2016-04-08 10:33:09 +08:00
Pavel Raiskup
c4184ba217 error.c: *input->cur == 0 does not mean no error
Complements: ce0b0d0d81
2016-04-08 10:32:29 +08:00
David Kilzer
49bbfdb6c9 Add missing RNG test files
For https://bugzilla.gnome.org/show_bug.cgi?id=760249

Add missing test results from Bug 710744 for commit
6473a41a49.
2016-04-08 10:20:22 +08:00
David Kilzer
6e3af87055 Bug 760190: configure.ac should be able to build --with-icu without icu-config tool <https://bugzilla.gnome.org/show_bug.cgi?id=760190>
* configure.ac: Add fallback tests if the icu-config tool is not
installed (like on Mac OS X).  This also allows an include
prefix to be set using "--with-icu=/prefix/to/icu", similar to
--with-iconv.
2016-04-08 10:19:18 +08:00
David Kilzer
4f8606c13c Bug 760183: REGRESSION (v2.9.3): XML push parser fails with bogus UTF-8 encoding error when multi-byte character in large CDATA section is split across buffer <https://bugzilla.gnome.org/show_bug.cgi?id=760183>
* parser.c:
(xmlCheckCdataPush): Add 'complete' argument to describe whether
the buffer passed in is the whole CDATA buffer, or if there is
more data to parse.  If there is more data to parse, don't
return a negative value for an invalid multi-byte UTF-8
character that is split between buffers.
(xmlParseTryOrFinish): Pass 'complete' argument to
xmlCheckCdataPush() as appropriate.

* result/cdata-2-byte-UTF-8.xml: Added.
* result/cdata-2-byte-UTF-8.xml.rde: Added.
* result/cdata-2-byte-UTF-8.xml.rdr: Added.
* result/cdata-2-byte-UTF-8.xml.sax: Added.
* result/cdata-2-byte-UTF-8.xml.sax2: Added.
* result/cdata-3-byte-UTF-8.xml: Added.
* result/cdata-3-byte-UTF-8.xml.rde: Added.
* result/cdata-3-byte-UTF-8.xml.rdr: Added.
* result/cdata-3-byte-UTF-8.xml.sax: Added.
* result/cdata-3-byte-UTF-8.xml.sax2: Added.
* result/cdata-4-byte-UTF-8.xml: Added.
* result/cdata-4-byte-UTF-8.xml.rde: Added.
* result/cdata-4-byte-UTF-8.xml.rdr: Added.
* result/cdata-4-byte-UTF-8.xml.sax: Added.
* result/cdata-4-byte-UTF-8.xml.sax2: Added.
* result/noent/cdata-2-byte-UTF-8.xml: Added.
* result/noent/cdata-3-byte-UTF-8.xml: Added.
* result/noent/cdata-4-byte-UTF-8.xml: Added.
* test/cdata-2-byte-UTF-8.xml: Added.
* test/cdata-3-byte-UTF-8.xml: Added.
* test/cdata-4-byte-UTF-8.xml: Added.
- Add tests and results.  Only 'make Readertests XMLPushtests'
  fails prior to the fix.
2016-04-08 10:18:52 +08:00
David Kilzer
e6b97476a0 Bug 758572: ASAN crash in make check <https://bugzilla.gnome.org/show_bug.cgi?id=758572>
Instead of sending a random string length into API methods,
compute the string length properly to fix out-of-bounds accesses
caught with AddressSanitizer turned on.

* testapi.c:
(test_htmlCreateMemoryParserCtxt):
(test_htmlCreatePushParserCtxt):
(test_htmlCtxtReadMemory):
(test_htmlParseChunk):
(test_htmlReadMemory):
(test_xmlDictExists):
(test_xmlDictLookup):
(test_xmlCreatePushParserCtxt):
(test_xmlCtxtReadMemory):
(test_xmlCtxtResetPush):
(test_xmlParseChunk):
(test_xmlParseInNodeContext):
(test_xmlParseMemory):
(test_xmlReadMemory):
(test_xmlRecoverMemory):
(test_xmlSAXParseMemory):
(test_xmlSAXParseMemoryWithData):
(test_xmlSAXUserParseMemory):
(test_xmlCreateMemoryParserCtxt):
(test_xmlRelaxNGNewMemParserCtxt):
(test_xmlBufferAdd):
(test_xmlBufferAddHead):
(test_xmlBuildQName):
(test_xmlDocDumpFormatMemory):
(test_xmlDocDumpFormatMemoryEnc):
(test_xmlDocDumpMemory):
(test_xmlNewCDataBlock):
(test_xmlNewDocTextLen):
(test_xmlNewTextLen):
(test_xmlNodeAddContentLen):
(test_xmlNodeSetContentLen):
(test_xmlSplitQName3):
(test_xmlStringLenGetNodeList):
(test_xmlTextConcat):
(test_xmlOutputBufferWrite):
(test_xmlParserInputBufferCreateMem):
(test_xmlParserInputBufferCreateStatic):
(test_xmlParserInputBufferPush):
(test_xmlReaderForMemory):
(test_xmlReaderNewMemory):
(test_xmlSchemaNewMemParserCtxt):
(test_xmlCharStrndup):
(test_xmlStrncatNew):
(test_xmlStrncmp):
(test_xmlStrndup):
(test_xmlStrsub):
(test_xmlTextWriterWriteBase64):
(test_xmlTextWriterWriteBinHex):
(test_xmlTextWriterWriteRawLen):
2016-04-08 10:18:06 +08:00
David Kilzer
783931fc59 Bug 721158: Missing ICU string when doing --version on xmllint <https://bugzilla.gnome.org/show_bug.cgi?id=721158>
* xmllint.c:
(showVersion): Add "ICU" to xmllint version string if libxml2 is
built with ICU enabled.
2016-04-08 10:16:54 +08:00
Michael Stahl
65112cb36a python 3: libxml2.c wrappers create Unicode str already
... so stop decoding these, which only results in
"TypeError: 'str' does not support the buffer interface".
2016-03-11 16:18:13 +08:00
Bruce Dawson
dfbacd4f41 win32\VC10\config.h and VS 2015
--047d7bacb4ee71848a052d7c673a
Content-Type: text/plain; charset=UTF-8

The config.h file in win32\VC10 is incompatible with VS 2015 because VS
2015 provides an implementation of snprintf and prohibits using the
preprocessor to define it. Therefor an ifdef check is needed around that
definition in VC10\config.h. Here is a patch that is compatible with the
change that we made to Chromium's copy:
2016-03-11 16:02:03 +08:00
orzen
0f84ee239f Add autogen.sh to distrib
For https://bugzilla.gnome.org/show_bug.cgi?id=761782

autogen.sh was not included in the tarball releases which complicates
situations when users have to make changes to e.g. configure.ac andi
have to re-generate configure.
2016-02-09 17:55:40 +01:00
orzen
b5ca260771 Add configure maintainer mode
For https://bugzilla.gnome.org/show_bug.cgi?id=761784

I wasn't able to build libxml2 because aclocal-1.13 was missing from
my machine. With AM_MAINTAINER_MODE, I'm able to configure libxml2 with
'--disable-maintainer-mode' which will disable checks for aclocal.
2016-02-09 17:23:48 +01:00
Daniel Veillard
a7a94612aa Heap-based buffer overread in xmlNextChar
For https://bugzilla.gnome.org/show_bug.cgi?id=759671

when the end of the internal subset isn't properly detected
xmlParseInternalSubset should just return instead of trying
to process input further.
2016-02-09 12:55:29 +01:00
Daniel Veillard
6657afe83a Release of libxml2-2.9.3
* configure.ac: updated
* doc/*: regenerated
2015-11-20 17:55:11 +08:00
Hugh Davenport
8fb4a77007 CVE-2015-8242 Buffer overead with HTML parser in push mode
For https://bugzilla.gnome.org/show_bug.cgi?id=756372
Error in the code pointing to the codepoint in the stack for the
current char value instead of the pointer in the input that the SAX
callback expects
Reported and fixed by Hugh Davenport
2015-11-20 17:16:06 +08:00
Daniel Veillard
f1063fdbe7 CVE-2015-7500 Fix memory access error due to incorrect entities boundaries
For https://bugzilla.gnome.org/show_bug.cgi?id=756525
handle properly the case where we popped out of the current entity
while processing a start tag
Reported by Kostya Serebryany @ Google

This slightly modifies the output of 754946 in regression tests
2015-11-20 16:06:59 +08:00
Daniel Veillard
fdfeecc1b7 Bug on creating new stream from entity
sometimes the entity could have a lenght of 0, i.e. it wasn't
parsed or used yet, and we ended up with an incoherent input state
2015-11-20 15:07:38 +08:00
Daniel Veillard
3bd6ae147e Fix some loop issues embedding NEXT
Next can switch the parser back to XML_PARSER_EOF state, we
need to consider those in loops consuming input
2015-11-20 15:06:02 +08:00
Daniel Veillard
35bcb1d758 Detect incoherency on GROW
the current pointer to the input has to be between the base and end
if not stop everything we have an internal state error.
2015-11-20 15:04:09 +08:00
Daniel Veillard
ce0b0d0d81 Do not print error context when there is none
Which now happens more frequently du to xmlHaltParser use
2015-11-20 15:01:22 +08:00
Daniel Veillard
e3b1597421 Reuse xmlHaltParser() where it makes sense
Unify the various place where either xmlStopParser was called
(which resets the error as a side effect) and places where we
used ctxt->instate = XML_PARSER_EOF to stop further processing
2015-11-20 14:59:30 +08:00
Daniel Veillard
28cd9cb747 Add xmlHaltParser() to stop the parser
The problem is doing it in a consistent and safe fashion
It's more complex than just setting ctxt->instate = XML_PARSER_EOF
Update the public function to reuse that new internal routine
2015-11-20 14:55:30 +08:00
David Drysdale
69030714cd CVE-2015-5312 Another entity expansion issue
For https://bugzilla.gnome.org/show_bug.cgi?id=756733
It is one case where the code in place to detect entities expansions
failed to exit when the situation was detected, leading to DoS
Problem reported by Kostya Serebryany @ Google
Patch provided by David Drysdale @ Google
2015-11-20 11:18:22 +08:00
David Drysdale
6360a31a84 CVE-2015-7497 Avoid an heap buffer overflow in xmlDictComputeFastQKey
For https://bugzilla.gnome.org/show_bug.cgi?id=756528
It was possible to hit a negative offset in the name indexing
used to randomize the dictionary key generation
Reported and fix provided by David Drysdale @ Google
2015-11-20 10:47:12 +08:00
Daniel Veillard
53ac9c9649 xmlStopParser reset errNo
I had used it in contexts where that information ought to be preserved
2015-11-09 18:16:00 +08:00
Daniel Veillard
afd27c21f6 Avoid processing entities after encoding conversion failures
For https://bugzilla.gnome.org/show_bug.cgi?id=756527
and was also raised by Chromium team in the past

When we hit a convwersion failure when switching encoding
it is bestter to stop parsing there, this was treated as a
fatal error but the parser was continuing to process to extract
more errors, unfortunately that makes little sense as the data
is obviously corrupt and can potentially lead to unexpected behaviour.
2015-11-09 18:07:18 +08:00
Hugh Davenport
ab2b9a93ff Avoid extra processing of MarkupDecl when EOF
For https://bugzilla.gnome.org/show_bug.cgi?id=756263

One place where ctxt->instate == XML_PARSER_EOF whic was set up
by entity detection issues doesn't get noticed, and even overrided
2015-11-03 20:40:49 +08:00