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>
This commit is contained in:
parent
be2e0996b1
commit
370d32dd3c
|
@ -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);
|
||||
|
|
|
@ -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) {
|
||||
/*
|
||||
|
|
|
@ -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 **/
|
||||
|
|
Loading…
Reference in New Issue