forked from osmocom/wireshark
CIP: Minor bug fixes
1. CIP: dissect_cip_set_attribute_list_req - Too many bytes highlighted. Could cause malformed packet 2. CIP: dissect_cip_cco_all_attribute_common - Too many bytes highlighted 3. CIP Motion: dissect_cntr_service - Wrong size passed in which tried to highlight too many bytes. Would cause malformed packet. 4. CIP: Some minor formatting/whitespace changes. Change-Id: I5899888a3e58452945c8546cf635768cdd3cf738 Reviewed-on: https://code.wireshark.org/review/18000 Petri-Dish: Alexis La Goutte <alexis.lagoutte@gmail.com> Tested-by: Petri Dish Buildbot <buildbot-no-reply@wireshark.org> Reviewed-by: Michael Mann <mmann78@netscape.net>
This commit is contained in:
parent
cda23193bf
commit
0f18087ca3
|
@ -5138,7 +5138,7 @@ dissect_cip_set_attribute_list_req(tvbuff_t *tvb, packet_info *pinfo, proto_tree
|
|||
proto_tree_add_item(tree, hf_cip_sc_set_attr_list_attr_count, tvb, offset, 2, ENC_LITTLE_ENDIAN);
|
||||
|
||||
/* Add Attribute List */
|
||||
att_list_tree = proto_tree_add_subtree(tree, tvb, offset+2, att_count*4, ett_cip_set_attribute_list, &att_list, "Attribute List" );
|
||||
att_list_tree = proto_tree_add_subtree(tree, tvb, offset+2, att_count*2, ett_cip_set_attribute_list, &att_list, "Attribute List" );
|
||||
offset += 2;
|
||||
start_offset = offset;
|
||||
|
||||
|
@ -5533,7 +5533,7 @@ dissect_cip_get_attribute_list_rsp(tvbuff_t *tvb, packet_info *pinfo, proto_tree
|
|||
proto_item *att_list, *att_item;
|
||||
proto_tree *att_tree, *att_list_tree;
|
||||
|
||||
/* Get attribute list request */
|
||||
/* Get attribute list response */
|
||||
if (tvb_reported_length_remaining(tvb, offset) < 2)
|
||||
{
|
||||
expert_add_info(pinfo, item, &ei_mal_serv_gal);
|
||||
|
@ -6824,7 +6824,7 @@ dissect_cip_cco_all_attribute_common( proto_tree *cmd_tree, tvbuff_t *tvb, int o
|
|||
variable_data_size += (iomap_size+4);
|
||||
|
||||
/* Proxy device id */
|
||||
tdi_tree = proto_tree_add_subtree( cmd_tree, tvb, offset+variable_data_size, 10, ett_cco_pdi, NULL, "Proxy Device ID");
|
||||
tdi_tree = proto_tree_add_subtree( cmd_tree, tvb, offset+variable_data_size, 8, ett_cco_pdi, NULL, "Proxy Device ID");
|
||||
|
||||
dissect_deviceid(tvb, offset+variable_data_size, tdi_tree,
|
||||
hf_cip_cco_pdi_vendor, hf_cip_cco_pdi_devtype, hf_cip_cco_pdi_prodcode,
|
||||
|
@ -6871,7 +6871,7 @@ dissect_cip_cco_all_attribute_common( proto_tree *cmd_tree, tvbuff_t *tvb, int o
|
|||
hf_cip_cco_lfwo_prio, hf_cip_cco_lfwo_fixed_var, hf_cip_cco_lfwo_con_size, ett_cco_ncp);
|
||||
|
||||
temp_data = tvb_get_letohl( tvb, offset+variable_data_size+10);
|
||||
proto_tree_add_uint_format_value(ncp_tree, hf_cip_cco_to_rpi, tvb, offset+variable_data_size+2, 4, temp_data, "%dms (0x%08X)", temp_data / 1000, temp_data);
|
||||
proto_tree_add_uint_format_value(ncp_tree, hf_cip_cco_to_rpi, tvb, offset+variable_data_size+10, 4, temp_data, "%dms (0x%08X)", temp_data / 1000, temp_data);
|
||||
|
||||
/* Display T->O network connection parameters */
|
||||
dissect_net_param32(tvb, offset+variable_data_size+14, ncp_tree,
|
||||
|
@ -6880,7 +6880,8 @@ dissect_cip_cco_all_attribute_common( proto_tree *cmd_tree, tvbuff_t *tvb, int o
|
|||
|
||||
variable_data_size += 18;
|
||||
}
|
||||
return variable_data_size;
|
||||
|
||||
return variable_data_size;
|
||||
}
|
||||
|
||||
static void
|
||||
|
|
|
@ -1292,21 +1292,24 @@ dissect_cntr_service(tvbuff_t* tvb, proto_tree* tree, guint32 offset, guint32 si
|
|||
proto_tree_add_item(header_tree, hf_cip_svc_code, tvb, offset + 1, 1, ENC_LITTLE_ENDIAN);
|
||||
|
||||
/* If the service is a set axis, get axis attribute or group sync request dissect it as well */
|
||||
switch(service)
|
||||
if (size > 4)
|
||||
{
|
||||
switch (service)
|
||||
{
|
||||
case SC_GET_AXIS_ATTRIBUTE_LIST:
|
||||
dissect_get_axis_attr_list_request(tvb, header_tree, offset + 4, size);
|
||||
dissect_get_axis_attr_list_request(tvb, header_tree, offset + 4, size - 4);
|
||||
break;
|
||||
case SC_SET_AXIS_ATTRIBUTE_LIST:
|
||||
dissect_set_axis_attr_list_request(tvb, header_tree, offset + 4, size);
|
||||
dissect_set_axis_attr_list_request(tvb, header_tree, offset + 4, size - 4);
|
||||
break;
|
||||
case SC_GROUP_SYNC:
|
||||
dissect_group_sync_request(tvb, header_tree, offset + 4, size);
|
||||
dissect_group_sync_request(tvb, header_tree, offset + 4, size - 4);
|
||||
break;
|
||||
default:
|
||||
/* Display the remainder of the service channel data */
|
||||
proto_tree_add_item(header_tree, hf_cip_svc_data, tvb, offset + 4, size - 4, ENC_NA);
|
||||
}
|
||||
}
|
||||
|
||||
return offset + size;
|
||||
}
|
||||
|
@ -1483,21 +1486,24 @@ dissect_devce_service(tvbuff_t* tvb, proto_tree* tree, guint32 offset, guint32 s
|
|||
proto_tree_add_item(header_tree, hf_cip_svc_ext_status, tvb, offset + 3, 1, ENC_LITTLE_ENDIAN);
|
||||
|
||||
/* If the service is a set axis, get axis attribute response or group sync dissect it as well */
|
||||
switch(tvb_get_guint8(tvb, offset + 1))
|
||||
if (size > 4)
|
||||
{
|
||||
switch (tvb_get_guint8(tvb, offset + 1))
|
||||
{
|
||||
case SC_GET_AXIS_ATTRIBUTE_LIST:
|
||||
dissect_get_axis_attr_list_response(tvb, header_tree, offset + 4, size);
|
||||
dissect_get_axis_attr_list_response(tvb, header_tree, offset + 4, size - 4);
|
||||
break;
|
||||
case SC_SET_AXIS_ATTRIBUTE_LIST:
|
||||
dissect_set_axis_attr_list_response(tvb, header_tree, offset + 4, size);
|
||||
dissect_set_axis_attr_list_response(tvb, header_tree, offset + 4, size - 4);
|
||||
break;
|
||||
case SC_GROUP_SYNC:
|
||||
dissect_group_sync_response(tvb, header_tree, offset + 4, size);
|
||||
dissect_group_sync_response(tvb, header_tree, offset + 4, size - 4);
|
||||
break;
|
||||
default:
|
||||
/* Display the remainder of the service channel data */
|
||||
proto_tree_add_item(header_tree, hf_cip_svc_data, tvb, offset + 4, size - 4, ENC_NA);
|
||||
}
|
||||
}
|
||||
|
||||
return offset + size;
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue