1
0
mirror of https://gitlab.gnome.org/GNOME/libxml2.git synced 2024-12-25 23:21:26 +03:00
libxml2/result/cdata-4-byte-UTF-8.xml.sax2
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

29 lines
867 B
Plaintext
Raw Blame History

SAX.setDocumentLocator()
SAX.startDocument()
SAX.comment( This tests that four-byte UTF-8 characters are parsed properly when split across a buffer boundary of length XML_PARSER_BIG_BUFFER_SIZE (300 bytes). )
SAX.startElementNs(doc, NULL, NULL, 0, 0, 0)
SAX.characters(
, 1)
SAX.startElementNs(p, NULL, NULL, 0, 0, 0)
SAX.pcdata(ðŸ<C3B0>¦ðŸ<C3B0>¦ðŸ<C3B0>¦ðŸ<C3B0>¦ðŸ<C3B0>¦, 1200)
SAX.endElementNs(p, NULL, NULL)
SAX.characters(
, 1)
SAX.startElementNs(p, NULL, NULL, 0, 0, 0)
SAX.pcdata( ðŸ<C3B0>¦ðŸ<C3B0>¦ðŸ<C3B0>¦ðŸ<C3B0>¦ðŸ<C3B0>, 1201)
SAX.endElementNs(p, NULL, NULL)
SAX.characters(
, 1)
SAX.startElementNs(p, NULL, NULL, 0, 0, 0)
SAX.pcdata( ðŸ<C3B0>¦ðŸ<C3B0>¦ðŸ<C3B0>¦ðŸ<C3B0>¦ðŸ, 1202)
SAX.endElementNs(p, NULL, NULL)
SAX.characters(
, 1)
SAX.startElementNs(p, NULL, NULL, 0, 0, 0)
SAX.pcdata( ðŸ<C3B0>¦ðŸ<C3B0>¦ðŸ<C3B0>¦ðŸ<C3B0>¦ð, 1203)
SAX.endElementNs(p, NULL, NULL)
SAX.characters(
, 1)
SAX.endElementNs(doc, NULL, NULL)
SAX.endDocument()