aboutsummaryrefslogtreecommitdiffstats
path: root/epan
diff options
context:
space:
mode:
authorEvan Huus <eapache@gmail.com>2014-09-28 17:56:16 -0400
committerEvan Huus <eapache@gmail.com>2014-09-29 00:12:32 +0000
commit94c47b12b0de4c8f7439d93a37485df296667ff7 (patch)
tree8043fd8a73ec57f6a69110d6fe085fbd5842d144 /epan
parent96835181e45135668b5c91736a388289a4e3d743 (diff)
mrcpv2: don't use an uninitialized buffer as a string
I have no idea what the original intent was with this magical otherwise-totally-unused buffer, but it clearly serves no purpose now. Stop reading garbage from it, and just read the data in the packet which is what the field name suggests. Bug: 10510 Change-Id: I05d0b98c04e59ea70247811168c4c8a64861f43d Reviewed-on: https://code.wireshark.org/review/4352 Petri-Dish: Evan Huus <eapache@gmail.com> Reviewed-by: Evan Huus <eapache@gmail.com>
Diffstat (limited to 'epan')
-rw-r--r--epan/dissectors/packet-mrcpv2.c6
1 files changed, 2 insertions, 4 deletions
diff --git a/epan/dissectors/packet-mrcpv2.c b/epan/dissectors/packet-mrcpv2.c
index ff295a24a4..75e859a6bf 100644
--- a/epan/dissectors/packet-mrcpv2.c
+++ b/epan/dissectors/packet-mrcpv2.c
@@ -428,7 +428,6 @@ dissect_mrcpv2_common(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree)
gint offset;
gint value_offset;
gint str_len;
- gchar helper_str[256];
gchar *header_name;
gchar *header_value;
LINE_TYPE line_type = UNKNOWN_LINE;
@@ -627,8 +626,7 @@ dissect_mrcpv2_common(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree)
if (content_length > 0)
{ /* content length > 0 and CRLF detected, this has to be msg body */
offset += 2; /* skip separating CRLF */
- proto_tree_add_string_format(mrcpv2_tree, hf_mrcpv2_Data, tvb, offset, tvb_len - offset,
- helper_str, "Message data: %s", tvb_format_text(tvb, offset, tvb_len - offset));
+ proto_tree_add_item(mrcpv2_tree, hf_mrcpv2_Data, tvb, offset, tvb_len - offset, ENC_ASCII|ENC_NA);
next_offset = tvb_len; /* we are done */
}
continue;
@@ -1080,7 +1078,7 @@ proto_register_mrcpv2(void)
FT_STRING, BASE_NONE, NULL, 0, NULL, HFILL }
},
{ &hf_mrcpv2_Data,
- { "Data", "mrcpv2.Data",
+ { "Message data", "mrcpv2.Data",
FT_STRING, BASE_NONE, NULL, 0, NULL, HFILL }
},
{ &hf_mrcpv2_Method,