aboutsummaryrefslogtreecommitdiffstats
path: root/epan/dissectors/packet-pktc.c
diff options
context:
space:
mode:
authorMartin Kaiser <wireshark@kaiser.cx>2016-02-05 17:49:25 +0100
committerMartin Kaiser <wireshark@kaiser.cx>2016-02-05 22:44:31 +0000
commit154e710857599fb91351d955360f1f1dd8eddd22 (patch)
treedd00dfb1aa05c6f5d3f47701c4e563bb08c9389d /epan/dissectors/packet-pktc.c
parentb3fb7f4baebfdc0d065baa9288792ac0a6aadbfa (diff)
pktc: don't THROW() an exception from a dissector
in the switch-case statements, we already show an expert info it should be sufficient to exit and report to the caller how many bytes we dissected as for the string, we can just calculate the length and let proto_tree_add_item() throw an exception if that length is invalid Change-Id: I310a4011cb112f3ed70e804c5b44d58f275fab6b Reviewed-on: https://code.wireshark.org/review/13745 Reviewed-by: Martin Kaiser <wireshark@kaiser.cx>
Diffstat (limited to 'epan/dissectors/packet-pktc.c')
-rw-r--r--epan/dissectors/packet-pktc.c6
1 files changed, 0 insertions, 6 deletions
diff --git a/epan/dissectors/packet-pktc.c b/epan/dissectors/packet-pktc.c
index 06ea5b5603..06a217b5f8 100644
--- a/epan/dissectors/packet-pktc.c
+++ b/epan/dissectors/packet-pktc.c
@@ -229,7 +229,6 @@ dissect_pktc_app_specific_data(packet_info *pinfo, proto_tree *parent_tree, tvbu
break;
default:
proto_tree_add_expert(tree, pinfo, &ei_pktc_unknown_kmmid, tvb, offset, 1);
- THROW(ReportedBoundsError); /* bail out and inform user we can't dissect the packet */
};
break;
case DOI_IPSEC:
@@ -247,12 +246,10 @@ dissect_pktc_app_specific_data(packet_info *pinfo, proto_tree *parent_tree, tvbu
break;
default:
proto_tree_add_expert(tree, pinfo, &ei_pktc_unknown_kmmid, tvb, offset, 1);
- THROW(ReportedBoundsError); /* bail out and inform user we can't dissect the packet */
};
break;
default:
proto_tree_add_expert(tree, pinfo, &ei_pktc_unknown_doi, tvb, offset, 1);
- THROW(ReportedBoundsError); /* bail out and inform user we can't dissect the packet */
}
proto_item_set_len(item, offset-old_offset);
@@ -308,7 +305,6 @@ dissect_pktc_list_of_ciphersuites(packet_info *pinfo _U_, proto_tree *parent_tre
break;
default:
proto_tree_add_expert(tree, pinfo, &ei_pktc_unknown_doi, tvb, offset, 1);
- THROW(ReportedBoundsError); /* bail out and inform user we can't dissect the packet */
}
proto_item_set_len(item, offset-old_offset);
@@ -527,8 +523,6 @@ dissect_pktc_mtafqdn_krbsafeuserdata(packet_info *pinfo, tvbuff_t *tvb, proto_tr
case PKTC_MTAFQDN_REP:
/* MTA FQDN */
string_len = tvb_reported_length_remaining(tvb, offset) - 4;
- if (string_len <= 0)
- THROW(ReportedBoundsError);
proto_tree_add_item(tree, hf_pktc_mtafqdn_fqdn, tvb, offset, string_len, ENC_ASCII|ENC_NA);
offset+=string_len;