diff options
author | Martin Kaiser <wireshark@kaiser.cx> | 2015-10-20 20:59:19 +0200 |
---|---|---|
committer | Michael Mann <mmann78@netscape.net> | 2015-10-24 23:59:33 +0000 |
commit | 3ea14493e7091cbfb40e0cb6bf9f91e78d57d9d4 (patch) | |
tree | 9369c0ee3fb00cb5546607607ff80d2238fa2a3e /epan/dissectors/packet-aeron.c | |
parent | d77c1e18ebb9569dcfbe386156d0342944cd3325 (diff) |
[aeron] a new-style dissector should return 0 (not -1) to reject a packet
we shouldn't throw an exception before we know that the packet
contains our protocol
Change-Id: Ic58cb985775766a18e9086fe52096e3290674515
Reviewed-on: https://code.wireshark.org/review/11248
Petri-Dish: Michael Mann <mmann78@netscape.net>
Tested-by: Petri Dish Buildbot <buildbot-no-reply@wireshark.org>
Reviewed-by: Michael Mann <mmann78@netscape.net>
Diffstat (limited to 'epan/dissectors/packet-aeron.c')
-rw-r--r-- | epan/dissectors/packet-aeron.c | 15 |
1 files changed, 9 insertions, 6 deletions
diff --git a/epan/dissectors/packet-aeron.c b/epan/dissectors/packet-aeron.c index d75e0b925f..ca3261fd9f 100644 --- a/epan/dissectors/packet-aeron.c +++ b/epan/dissectors/packet-aeron.c @@ -2735,13 +2735,16 @@ static int dissect_aeron(tvbuff_t * tvb, packet_info * pinfo, proto_tree * tree, int length_remaining; aeron_conversation_info_t * cinfo; - /* Get enough information to determine the conversation info */ + /* Get enough information to determine the conversation info. + Make sure that we don't throw an exception before we know that + this packet contains our protocol. */ + if (tvb_captured_length_remaining(tvb, offset) < 2) + return 0; frame_type = tvb_get_letohs(tvb, offset + O_AERON_BASIC_TYPE); cinfo = aeron_setup_conversation_info(pinfo, frame_type); - if (cinfo == NULL) - { - return (-1); - } + if (!cinfo) + return 0; + col_add_str(pinfo->cinfo, COL_PROTOCOL, "Aeron"); col_clear(pinfo->cinfo, COL_INFO); col_add_str(pinfo->cinfo, COL_INFO, aeron_format_transport_uri(cinfo)); @@ -2856,7 +2859,7 @@ static gboolean test_aeron_packet(tvbuff_t * tvb, packet_info * pinfo, proto_tre } } rc = dissect_aeron(tvb, pinfo, tree, user_data); - if (rc == -1) + if (rc == 0) { return (FALSE); } |