1
0
mirror of https://gitlab.gnome.org/GNOME/libxml2.git synced 2024-10-27 04:55:04 +03:00
Commit Graph

4441 Commits

Author SHA1 Message Date
Daniel Veillard
8effcb578e Fix apibuild for a recently added construct
commit c71f9305a9 added __XML_EXTERNC
cpp construct which not understood by apibuild, leading to make dist
failures, ask to ignore that construct.
2016-05-09 10:31:09 +08:00
Stewart Brodie
45f0abd427 Use pkg-config to locate zlib when possible
For https://bugzilla.gnome.org/show_bug.cgi?id=765979

This fallback to direct detection if not available, but current situation
this is broken for cross compilation
2016-05-09 10:13:12 +08:00
Stewart Brodie
3d75c2e828 Use pkg-config to locate ICU when possible
For https://bugzilla.gnome.org/show_bug.cgi?id=765979

This fallback to icu-config if not available, but current situation
this is broken for cross compilation
2016-05-09 10:11:05 +08:00
Daniel Veillard
34b350048d Fix an error with regexp on nullable counted char transition
This is the first of the two issues raised by Pete Cordell
in https://mail.gnome.org/archives/xml/2016-April/msg00030.html
2016-05-09 09:28:38 +08:00
Nick Wellnhofer
6eb0894a96 Fix memory leak with XPath namespace nodes
Set hasNsNodes to 1 when adding namespace nodes via XP_TEST_HIT.
2016-05-05 17:38:27 +02:00
Nick Wellnhofer
82b73039dc Fix namespace axis traversal
When the namespace axis is traversed in "toBool" mode, the traversal
can exit early, before visiting all nodes. In this case, the XPath
context still contains a non-NULL tmpNsList.

This means that

- the check when to start a new traversal was wrong and
- the tmpNsList could be leaked.

Fixes bug #750037 and, by accident, bug #756075:

https://bugzilla.gnome.org/show_bug.cgi?id=750037
https://bugzilla.gnome.org/show_bug.cgi?id=756075
2016-05-05 15:30:00 +02:00
Daniel Veillard
9b4b8cb3e2 Add a make rule to rebuild for ASAN 2016-05-04 12:33:32 +08:00
Hugh Davenport
b8e0fa3489 Fix null pointer deref in docs with no root element
From https://bugzilla.gnome.org/show_bug.cgi?id=758514
2016-05-04 10:55:49 +08:00
Patrick Monnerat
90da33cebe Portability to non C99 compliant compilers
OS400 C compiler is not C99 compliant.
It only supports local variable declarations at the beginning of a block.
We loose the const as a result but portability is more important.
2016-05-03 21:37:52 +08:00
Patrick Monnerat
c71f9305a9 dict.h: Move xmlDictPtr definition before includes to allow direct inclusion. 2016-05-03 13:52:00 +08:00
Alex Henrie
f6599c5164 Fix XSD validation of URIs with ampersands
For https://bugzilla.gnome.org/show_bug.cgi?id=709171

This makes xmlSchemaSAXHandleStartElementNs pass attributes through
xmlStringDecodeEntities, similar to how xmlSchemaVDocWalk passes them
through xmlNodeListGetString.
2016-05-03 13:25:45 +08:00
Patrick Monnerat
a1dca81df7 xmlschemastypes.c: accept endOfDayFrag Times set to "24:00:00" mean "end of day" and should not cause an error. 2016-05-01 18:43:40 +08:00
Patrick Monnerat
b29377109b os400: tell about xmllint and xmlcatalog in README400. 2016-05-01 18:36:36 +08:00
Patrick Monnerat
c04785d5f5 os400: properly process SGML add in XMLCATALOG command. 2016-05-01 18:35:41 +08:00
Patrick Monnerat
9b5a57cf37 os400: implement CL command XMLCATALOG. 2016-05-01 18:35:11 +08:00
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