packet-iwarp-mpa.c: Stop FPDU dissection if the ULPDU_LENGTH field does NOT contain what is expected

Bug: 14236
Change-Id: I15f1bc70978d1e5ae3b4bba1ff87b590726cfaa1
Reviewed-on: https://code.wireshark.org/review/24578
Reviewed-by: Michael Mann <mmann78@netscape.net>
Petri-Dish: Michael Mann <mmann78@netscape.net>
Tested-by: Petri Dish Buildbot
Reviewed-by: Anders Broman <a.broman58@gmail.com>
This commit is contained in:
Michael Mann 2017-11-25 00:32:23 -05:00 committed by Anders Broman
parent d2a7a806ff
commit f23a6e193f
1 changed files with 3 additions and 6 deletions

View File

@ -687,8 +687,6 @@ dissect_mpa_fpdu(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree,
/* get ULPDU length of this FPDU */
ulpdu_length = (guint16) tvb_get_ntohs(tvb, offset);
mpa_packetlist(pinfo, MPA_FPDU);
if (state->minfo[endpoint].valid) {
num_of_m = number_of_markers(state, tcpinfo, endpoint);
}
@ -707,12 +705,11 @@ dissect_mpa_fpdu(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree,
pad_length = fpdu_pad_length(ulpdu_length);
exp_ulpdu_length = expected_ulpdu_length(state, tcpinfo, endpoint);
if (!exp_ulpdu_length || exp_ulpdu_length != (ulpdu_length + pad_length)) {
proto_tree_add_expert_format(tree, pinfo, &ei_mpa_bad_length, tvb, offset,
MPA_ULPDU_LENGTH_LEN,
"[ULPDU length [%u] field does not contain the expected length[%u]]",
exp_ulpdu_length, ulpdu_length + pad_length);
return 0;
}
mpa_packetlist(pinfo, MPA_FPDU);
mpa_item = proto_tree_add_item(tree, proto_iwarp_mpa, tvb, 0,
-1, ENC_NA);
mpa_tree = proto_item_add_subtree(mpa_item, ett_mpa);