aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorRoland Knall <roland.knall@br-automation.com>2018-01-19 13:47:01 +0100
committerMichael Mann <mmann78@netscape.net>2018-01-19 13:25:51 +0000
commit8631ceaefc44bb2246f05cfbe5db8aedbcdefa78 (patch)
tree76221bb59e30ebf463e6b9119b804b21a23c3a95
parent3438092b27b52c561dc2e5a8ca0b322b0320658c (diff)
epl: Correctly display the error for available bytes
Don't break the remaining length by setting and invalid one Change-Id: Ia32798db73937ada6c99a6927cc87402603a9e75 Reviewed-on: https://code.wireshark.org/review/25391 Reviewed-by: Michael Mann <mmann78@netscape.net>
-rw-r--r--epan/dissectors/packet-epl.c7
1 files changed, 4 insertions, 3 deletions
diff --git a/epan/dissectors/packet-epl.c b/epan/dissectors/packet-epl.c
index cbb129635f..c11f84509c 100644
--- a/epan/dissectors/packet-epl.c
+++ b/epan/dissectors/packet-epl.c
@@ -3763,11 +3763,12 @@ dissect_epl_sdo_command(proto_tree *epl_tree, tvbuff_t *tvb, packet_info *pinfo,
proto_tree_add_item(sdo_cmd_tree, hf_epl_asnd_sdo_cmd_command_id, tvb, offset, 1, ENC_LITTLE_ENDIAN);
offset += 1;
- proto_tree_add_item(sdo_cmd_tree, hf_epl_asnd_sdo_cmd_segment_size, tvb, offset, 2, ENC_LITTLE_ENDIAN);
+ item = proto_tree_add_item(sdo_cmd_tree, hf_epl_asnd_sdo_cmd_segment_size, tvb, offset, 2, ENC_LITTLE_ENDIAN);
offset += 4;
+ if ( tvb_reported_length_remaining(tvb, offset) < segment_size )
+ expert_add_info_format(pinfo, item, &ei_real_length_differs,
+ "Captured length differs, only %d octets will be displayed", tvb_reported_length_remaining(tvb, offset) - 4 );
}
- /* adjust size of packet */
- tvb_set_reported_length(tvb, offset + segment_size);
if (segmented == EPL_ASND_SDO_CMD_SEGMENTATION_INITIATE_TRANSFER)
{