diff options
author | Alexis La Goutte <alexis.lagoutte@gmail.com> | 2015-12-01 21:37:42 +0100 |
---|---|---|
committer | Anders Broman <a.broman58@gmail.com> | 2015-12-11 05:13:54 +0000 |
commit | 9c47cb4254e6aa188cd15c1aebe660a6356d91ca (patch) | |
tree | 339aa683e11664cd7c4454c0ee6698806267bf5a | |
parent | 99028789cbf3f0e6193d6158ff9e0e3b11b2c505 (diff) |
Fix Recurring check found by PVS Studio (V571)
packet-ncp2222.inc: The 'ncp_rec->func == 0x59' condition was already verified in line 7300.
packet-bgp: The 'nlri_len < 21' condition was already verified in line 3879
packet-rtp.c: The 'p_conv_data' condition was already verified in line 1460
Change-Id: I65299718b26454596e3f25665d413a17a99e4ce0
Reviewed-on: https://code.wireshark.org/review/12341
Petri-Dish: Alexis La Goutte <alexis.lagoutte@gmail.com>
Tested-by: Petri Dish Buildbot <buildbot-no-reply@wireshark.org>
Reviewed-by: Alexis La Goutte <alexis.lagoutte@gmail.com>
-rw-r--r-- | epan/dissectors/packet-bgp.c | 8 | ||||
-rw-r--r-- | epan/dissectors/packet-ncp2222.inc | 2 | ||||
-rw-r--r-- | epan/dissectors/packet-rtp.c | 2 |
3 files changed, 5 insertions, 7 deletions
diff --git a/epan/dissectors/packet-bgp.c b/epan/dissectors/packet-bgp.c index a2ac77cca8..56f7094d25 100644 --- a/epan/dissectors/packet-bgp.c +++ b/epan/dissectors/packet-bgp.c @@ -3883,11 +3883,9 @@ static int decode_evpn_nlri(proto_tree *tree, tvbuff_t *tvb, gint offset, packet 1, ENC_BIG_ENDIAN); if (route_type == EVPN_ETH_SEGMENT_ROUTE && nlri_len < 21) { - if (nlri_len < 21) { - expert_add_info_format(pinfo, prefix_tree, &ei_bgp_evpn_nlri_rt4_len_err, - "Invalid length (%u) of EVPN NLRI Route Type 4 (Ethernet Segment Route)!", nlri_len); - return -1; - } + expert_add_info_format(pinfo, prefix_tree, &ei_bgp_evpn_nlri_rt4_len_err, + "Invalid length (%u) of EVPN NLRI Route Type 4 (Ethernet Segment Route)!", nlri_len); + return -1; } item = proto_tree_add_item(prefix_tree, hf_bgp_evpn_nlri_rd, tvb, start_offset+2, diff --git a/epan/dissectors/packet-ncp2222.inc b/epan/dissectors/packet-ncp2222.inc index 205cb9f723..b99d48ecd8 100644 --- a/epan/dissectors/packet-ncp2222.inc +++ b/epan/dissectors/packet-ncp2222.inc @@ -7298,7 +7298,7 @@ dissect_ncp_request(tvbuff_t *tvb, packet_info *pinfo, } /* Need to parse for Novell specific wildcard values in Search Pattern, decode this ncp (89)/20 and (89)/03 req manually here. */ if (ncp_rec->func == 0x59 && (ncp_rec->subfunc == 0x14 || ncp_rec->subfunc == 0x03)) { - if (ncp_rec->func == 0x59 && ncp_rec->subfunc == 0x03) + if (ncp_rec->subfunc == 0x03) { dissect_ncp_8x20req(tvb, ncp_tree, 26, ncp_rec->func); } diff --git a/epan/dissectors/packet-rtp.c b/epan/dissectors/packet-rtp.c index 768e104d80..543fa33bea 100644 --- a/epan/dissectors/packet-rtp.c +++ b/epan/dissectors/packet-rtp.c @@ -1460,7 +1460,7 @@ process_rtp_payload(tvbuff_t *newtvb, packet_info *pinfo, proto_tree *tree, } else if (p_conv_data && !p_conv_data->bta2dp_info && !p_conv_data->btvdp_info && payload_type >= PT_UNDF_96 && payload_type <= PT_UNDF_127) { /* if the payload type is dynamic, we check if the conv is set and we look for the pt definition */ - if (p_conv_data && p_conv_data->rtp_dyn_payload) { + if (p_conv_data->rtp_dyn_payload) { const gchar *payload_type_str = rtp_dyn_payload_get_name(p_conv_data->rtp_dyn_payload, payload_type); if (payload_type_str) { int len; |