After an evaluation, GNOME has moved from Bugzilla to GitLab. Learn more about GitLab.
No new issues can be reported in GNOME Bugzilla anymore.
To report an issue in a GNOME project, go to GNOME GitLab.
Do not go to GNOME Gitlab for: Bluefish, Doxygen, GnuCash, GStreamer, java-gnome, LDTP, NetworkManager, Tomboy.
Bug 725433 - Simple XML Subset Parser doesn't strip out CDATA sections completely
Simple XML Subset Parser doesn't strip out CDATA sections completely
Status: RESOLVED NOTABUG
Product: glib
Classification: Platform
Component: general
2.0.x
Other Linux
: Normal normal
: ---
Assigned To: gtkdev
gtkdev
Depends on:
Blocks:
 
 
Reported: 2014-03-01 07:00 UTC by Nodar Nutsubidze
Modified: 2015-09-05 16:58 UTC
See Also:
GNOME target: ---
GNOME version: ---


Attachments
XML test file (133 bytes, text/plain)
2014-03-01 07:00 UTC, Nodar Nutsubidze
Details

Description Nodar Nutsubidze 2014-03-01 07:00:12 UTC
Created attachment 270619 [details]
XML test file

Using the Simple XML parser, when creating a new context with the G_MARKUP_TREAT_CDATA_AS_TEXT flag, the resulting text handler is passed in the following incorrect text: This is CDATA]]> (The problem is the ]]> is not stripped out)

Attached is the XML document that sees the behavior.

Code:
int flags = G_MARKUP_TREAT_CDATA_AS_TEXT;
context = g_markup_parse_context_new(&_full_parser, flags, NULL, NULL);
...

If a more detailed coding example is necessary let me know.

====== System Info =======
lsb_release -a
----------------
No LSB modules are available.
Distributor ID: Ubuntu
Description:    Ubuntu 12.04.2 LTS
Release:        12.04
Codename:       precise

uname -a
--------
Linux testbox 3.2.0-33-generic #52-Ubuntu SMP Thu Oct 18 16:29:15 UTC 2012 x86_64 x86_64 x86_64 GNU/Linux
Comment 1 Matthias Clasen 2014-03-03 00:14:40 UTC
I'm not seeing that here, in git master. I've added your example as a testcase to our testsuite, and it produces the expected output.
Comment 2 Nodar Nutsubidze 2014-03-03 00:42:04 UTC
Hmm? Does the original code section look correct?

I just upgraded libglib2.0-dev which upgraded it to 2.32.4. Again I ran it with that flag and got the incorrect result where the end CDATA tag is incorrect.
--------------
$ sudo apt-get install libglib2.0-dev
Setting up libglib2.0-0 (2.32.4-0ubuntu1) ...
Setting up libglib2.0-bin (2.32.4-0ubuntu1) ...
Setting up libglib2.0-dev (2.32.4-0ubuntu1) ...
--------------

Could you provide the code of how the test is running it against the file I provided. Perhaps I'm not calling it correctly.
Comment 3 Matthias Clasen 2015-09-05 16:58:36 UTC
See 

commit 79caa3a7e151897b062f82251eec207bc1514ff3
Author: Matthias Clasen <mclasen@redhat.com>
Date:   Sun Mar 2 19:10:00 2014 -0500

    Add a few tests for G_MARKUP_TREAT_CDATA_AS_TEXT
    
    Related to
    https://bugzilla.gnome.org/show_bug.cgi?id=725433