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>
This commit is contained in:
Evan Huus 2014-09-28 17:56:16 -04:00
parent 96835181e4
commit 94c47b12b0
1 changed files with 2 additions and 4 deletions

View File

@ -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,