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>
This commit is contained in:
Roland Knall 2018-01-19 13:47:01 +01:00 committed by Michael Mann
parent 3438092b27
commit 8631ceaefc
1 changed files with 4 additions and 3 deletions

View File

@ -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)
{