diff options
author | Michael Mann <mmann78@netscape.net> | 2015-11-27 17:35:27 -0500 |
---|---|---|
committer | Anders Broman <a.broman58@gmail.com> | 2015-11-30 09:14:03 +0000 |
commit | 370d32dd3cc9fda4b4ceee9ca2f2ef1bd953c51d (patch) | |
tree | d4a19e056f7b2381ec075518450d9545c151b40f | |
parent | be2e0996b1b57f80bd9ce2360dd0d70a952a9fc8 (diff) |
Remove some THROWs and just return when lengths are bad.
Change-Id: I4e01117e0cf0600be75f75336f22d011c4964113
Reviewed-on: https://code.wireshark.org/review/12298
Reviewed-by: Michael Mann <mmann78@netscape.net>
Petri-Dish: Michael Mann <mmann78@netscape.net>
Tested-by: Petri Dish Buildbot <buildbot-no-reply@wireshark.org>
Reviewed-by: Anders Broman <a.broman58@gmail.com>
-rw-r--r-- | epan/dissectors/packet-ppi.c | 10 | ||||
-rw-r--r-- | epan/dissectors/packet-v5dl.c | 2 | ||||
-rw-r--r-- | epan/dissectors/packet-xtp.c | 4 |
3 files changed, 8 insertions, 8 deletions
diff --git a/epan/dissectors/packet-ppi.c b/epan/dissectors/packet-ppi.c index ee31a2464f..640840e3f0 100644 --- a/epan/dissectors/packet-ppi.c +++ b/epan/dissectors/packet-ppi.c @@ -480,7 +480,7 @@ dissect_80211_common(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, int of if (data_len != PPI_80211_COMMON_LEN) { proto_tree_add_expert_format(ftree, pinfo, &ei_ppi_invalid_length, tvb, offset, data_len, "Invalid length: %u", data_len); - THROW(ReportedBoundsError); + return; } common_flags = tvb_get_letohs(tvb, offset + 8); @@ -664,7 +664,7 @@ dissect_80211n_mac(tvbuff_t *tvb, packet_info *pinfo _U_, proto_tree *tree, int if (data_len != PPI_80211N_MAC_LEN) { proto_tree_add_expert_format(ftree, pinfo, &ei_ppi_invalid_length, tvb, offset, data_len, "Invalid length: %u", data_len); - THROW(ReportedBoundsError); + return; } csr = ptvcursor_new(ftree, tvb, offset); @@ -711,7 +711,7 @@ dissect_80211n_mac_phy(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, int if (data_len != PPI_80211N_MAC_PHY_LEN) { proto_tree_add_expert_format(ftree, pinfo, &ei_ppi_invalid_length, tvb, offset, data_len, "Invalid length: %u", data_len); - THROW(ReportedBoundsError); + return; } dissect_80211n_mac(tvb, pinfo, ftree, offset, PPI_80211N_MAC_LEN, @@ -790,7 +790,7 @@ dissect_aggregation_extension(tvbuff_t *tvb, packet_info *pinfo _U_, proto_tree if (data_len != PPI_AGGREGATION_EXTENSION_LEN) { proto_tree_add_expert_format(ftree, pinfo, &ei_ppi_invalid_length, tvb, offset, data_len, "Invalid length: %u", data_len); - THROW(ReportedBoundsError); + return; } csr = ptvcursor_new(ftree, tvb, offset); @@ -811,7 +811,7 @@ dissect_8023_extension(tvbuff_t *tvb, packet_info *pinfo _U_, proto_tree *tree, if (data_len != PPI_8023_EXTENSION_LEN) { proto_tree_add_expert_format(ftree, pinfo, &ei_ppi_invalid_length, tvb, offset, data_len, "Invalid length: %u", data_len); - THROW(ReportedBoundsError); + return; } csr = ptvcursor_new(ftree, tvb, offset); diff --git a/epan/dissectors/packet-v5dl.c b/epan/dissectors/packet-v5dl.c index 97c06ea658..0879082c19 100644 --- a/epan/dissectors/packet-v5dl.c +++ b/epan/dissectors/packet-v5dl.c @@ -233,7 +233,7 @@ dissect_v5dl(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void* data _U_ * checksum overlaps the header. */ if (reported_length < v5dl_header_len + 2) - THROW(ReportedBoundsError); + return; if (length == reported_length) { /* diff --git a/epan/dissectors/packet-xtp.c b/epan/dissectors/packet-xtp.c index a9f4d1ae69..29eaba8681 100644 --- a/epan/dissectors/packet-xtp.c +++ b/epan/dissectors/packet-xtp.c @@ -763,12 +763,12 @@ dissect_xtp_ecntl(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, if (len != spans_len) { expert_add_info_format(pinfo, top_ti, &ei_xtp_spans_bad, "Number of spans (%u) incorrect. Should be %u.", ecntl->nspan, len); - THROW(ReportedBoundsError); + return; } if (ecntl->nspan > XTP_MAX_NSPANS) { expert_add_info_format(pinfo, top_ti, &ei_xtp_spans_bad, "Too many spans: %u", ecntl->nspan); - THROW(ReportedBoundsError); + return; } /** add summary **/ |