Added XML proper decoding for XML CDATASection

Bug: 11755
Change-Id: Iecf7ce4bfad45d0c49f3af205e8489e53077198b
Reviewed-on: https://code.wireshark.org/review/15889
Petri-Dish: Alexis La Goutte <alexis.lagoutte@gmail.com>
Tested-by: Petri Dish Buildbot <buildbot-no-reply@wireshark.org>
Reviewed-by: Pascal Quantin <pascal.quantin@gmail.com>
Reviewed-by: Anders Broman <a.broman58@gmail.com>
This commit is contained in:
Binh Trinh 2016-06-14 00:37:53 -04:00 committed by Anders Broman
parent cbfa81769f
commit f8031fa50c
1 changed files with 15 additions and 0 deletions

View File

@ -60,6 +60,7 @@ static int hf_comment = -1;
static int hf_xmlpi = -1;
static int hf_dtd_tag = -1;
static int hf_doctype = -1;
static int hf_cdatasection = -1;
static expert_field ei_xml_closing_unopened_tag = EI_INIT;
static expert_field ei_xml_closing_unopened_xmpli_tag = EI_INIT;
@ -686,6 +687,13 @@ static void init_xml_parser(void)
TP_UNTIL_INCLUDE),
NULL);
tvbparse_wanted_t *want_cdatasection = tvbparse_set_seq(hf_cdatasection, NULL, NULL, after_token,
tvbparse_string(-1, "<![CDATA[", NULL, NULL, NULL),
tvbparse_until(-1, NULL, NULL, NULL,
tvbparse_string(-1, "]]>", NULL, NULL, NULL),
TP_UNTIL_INCLUDE),
NULL);
tvbparse_wanted_t *want_xmlpi = tvbparse_set_seq(hf_xmlpi, NULL, before_xmpli, NULL,
tvbparse_string(-1, "<?", NULL, NULL, NULL),
want_name,
@ -757,6 +765,7 @@ static void init_xml_parser(void)
want = tvbparse_set_oneof(-1, NULL, NULL, NULL,
want_comment,
want_cdatasection,
want_xmlpi,
want_closing_tag,
want_doctype_start,
@ -769,6 +778,7 @@ static void init_xml_parser(void)
want_heur = tvbparse_set_oneof(-1, NULL, NULL, NULL,
want_comment,
want_cdatasection,
want_xmlpi,
want_doctype_start,
want_dtd_tag,
@ -1374,6 +1384,11 @@ proto_register_xml(void)
FT_STRING, BASE_NONE, NULL, 0,
NULL, HFILL }
},
{ &hf_cdatasection,
{"CDATASection", "xml.cdatasection",
FT_STRING, BASE_NONE, NULL, 0,
NULL, HFILL }
},
{ &hf_comment,
{"Comment", "xml.comment",
FT_STRING, BASE_NONE, NULL, 0,