diff options
author | Jaap Keuter <jaap.keuter@xs4all.nl> | 2016-06-07 23:56:59 +0200 |
---|---|---|
committer | Michael Mann <mmann78@netscape.net> | 2016-06-08 10:21:13 +0000 |
commit | c1a38296e79ecaa2a23707a7672097ac91205ebb (patch) | |
tree | 652891d99f55c1f425af5b5bb2b936ced222ef1f /epan/dissectors/packet-cip.c | |
parent | 74484c6ebf961769f8f44d8b95ebeb7532f47a93 (diff) |
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>
Diffstat (limited to 'epan/dissectors/packet-cip.c')
-rw-r--r-- | epan/dissectors/packet-cip.c | 27 |
1 files changed, 3 insertions, 24 deletions
diff --git a/epan/dissectors/packet-cip.c b/epan/dissectors/packet-cip.c index 73f09d5ec5..6293dc1158 100644 --- a/epan/dissectors/packet-cip.c +++ b/epan/dissectors/packet-cip.c @@ -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 */ |