Remove superfluous size checks (CID-1158694)

Don't try to add expert items for size < 1 when this code isn't
executed for size == 0. (note: size is unsigned)

Change-Id: Ieb3d2593d4bb5f175ac368ef38571511b4f56f25
Reviewed-on: https://code.wireshark.org/review/15774
Reviewed-by: Alexis La Goutte <alexis.lagoutte@gmail.com>
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:
Jaap Keuter 2016-06-07 23:56:59 +02:00 committed by Michael Mann
parent 74484c6ebf
commit c1a38296e7
1 changed files with 3 additions and 24 deletions

View File

@ -6220,34 +6220,13 @@ dissect_cip_cm_data( proto_tree *item_tree, tvbuff_t *tvb, int offset, int item_
}
break;
case CM_ES_INVALID_CONFIGURATION_SIZE:
if (add_stat_size < 1)
{
expert_add_info(pinfo, status_item, &ei_mal_inv_config_size);
}
else
{
proto_tree_add_item(status_tree, hf_cip_cm_ext126_size, tvb, offset+6, 2, ENC_LITTLE_ENDIAN );
}
proto_tree_add_item(status_tree, hf_cip_cm_ext126_size, tvb, offset+6, 2, ENC_LITTLE_ENDIAN );
break;
case CM_ES_INVALID_OT_SIZE:
if (add_stat_size < 1)
{
expert_add_info(pinfo, status_item, &ei_mal_ot_size);
}
else
{
proto_tree_add_item(status_tree, hf_cip_cm_ext127_size, tvb, offset+6, 2, ENC_LITTLE_ENDIAN );
}
proto_tree_add_item(status_tree, hf_cip_cm_ext127_size, tvb, offset+6, 2, ENC_LITTLE_ENDIAN );
break;
case CM_ES_INVALID_TO_SIZE:
if (add_stat_size < 1)
{
expert_add_info(pinfo, status_item, &ei_mal_to_size);
}
else
{
proto_tree_add_item(status_tree, hf_cip_cm_ext128_size, tvb, offset+6, 2, ENC_LITTLE_ENDIAN );
}
proto_tree_add_item(status_tree, hf_cip_cm_ext128_size, tvb, offset+6, 2, ENC_LITTLE_ENDIAN );
break;
default:
/* Add additional status */