aboutsummaryrefslogtreecommitdiffstats
path: root/epan/dissectors/packet-xml.c
diff options
context:
space:
mode:
authorEvan Huus <eapache@gmail.com>2021-09-15 11:48:47 -0400
committerWireshark GitLab Utility <gerald+gitlab-utility@wireshark.org>2021-09-16 06:54:42 +0000
commitf4aa108913db786e8dc4c2333849c8c07afebb2c (patch)
tree8f40c7f344debc3745be554205e1268df6092b3d /epan/dissectors/packet-xml.c
parent2cb1eb955f3038e8e1a1fde655186fe786cb2a04 (diff)
tvbparse: explicitly memory-scope parser
Avoids the use of the global memory pool in favour of one the compiler actually knows must be in scope. Also delete a few-hundred lines of if-0ed code that hadn't been active in 15+ years.
Diffstat (limited to 'epan/dissectors/packet-xml.c')
-rw-r--r--epan/dissectors/packet-xml.c6
1 files changed, 3 insertions, 3 deletions
diff --git a/epan/dissectors/packet-xml.c b/epan/dissectors/packet-xml.c
index b8fef92261..073e80e806 100644
--- a/epan/dissectors/packet-xml.c
+++ b/epan/dissectors/packet-xml.c
@@ -270,7 +270,7 @@ dissect_xml(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void* data _U_)
decoded = tvb;
}
- tt = tvbparse_init(decoded, 0, -1, stack, want_ignore);
+ tt = tvbparse_init(pinfo->pool, decoded, 0, -1, stack, want_ignore);
current_frame->start_offset = 0;
current_frame->length = tvb_captured_length(decoded);
@@ -307,7 +307,7 @@ dissect_xml(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void* data _U_)
static gboolean dissect_xml_heur(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void *data)
{
- if (tvbparse_peek(tvbparse_init(tvb, 0, -1, NULL, want_ignore), want_heur)) {
+ if (tvbparse_peek(tvbparse_init(pinfo->pool, tvb, 0, -1, NULL, want_ignore), want_heur)) {
dissect_xml(tvb, pinfo, tree, data);
return TRUE;
} else if (pref_heuristic_unicode) {
@@ -329,7 +329,7 @@ static gboolean dissect_xml_heur(tvbuff_t *tvb, packet_info *pinfo, proto_tree *
data_str = tvb_get_string_enc(pinfo->pool, tvb, 0, tvb_captured_length(tvb), enc);
l = strlen(data_str);
unicode_tvb = tvb_new_child_real_data(tvb, data_str, (guint)l, (gint)l);
- if (tvbparse_peek(tvbparse_init(unicode_tvb, 0, -1, NULL, want_ignore), want_heur)) {
+ if (tvbparse_peek(tvbparse_init(pinfo->pool, unicode_tvb, 0, -1, NULL, want_ignore), want_heur)) {
add_new_data_source(pinfo, unicode_tvb, "UTF8");
dissect_xml(unicode_tvb, pinfo, tree, data);
return TRUE;