diff options
author | Pascal Quantin <pascal.quantin@gmail.com> | 2015-10-31 22:05:45 +0100 |
---|---|---|
committer | Michael Mann <mmann78@netscape.net> | 2015-11-01 03:21:15 +0000 |
commit | ced7412c1062a74afc3f973fe1e3d1238a0acf40 (patch) | |
tree | d075adc14d1a8e7dd110549c6f66380537dc7dae /epan/dissectors | |
parent | 9180c27c5e47ce4fc8f92113c9e51a5b7294da9b (diff) |
TCP: replace some dissector asserts by a return
It prevents an assert in case of malformed packet
Bug: 11662
Change-Id: If5d7196c7e6ecd0ffe8ed97213dbd64bc1f69cbb
Reviewed-on: https://code.wireshark.org/review/11464
Reviewed-by: Pascal Quantin <pascal.quantin@gmail.com>
Petri-Dish: Pascal Quantin <pascal.quantin@gmail.com>
Tested-by: Petri Dish Buildbot <buildbot-no-reply@wireshark.org>
Reviewed-by: Michael Mann <mmann78@netscape.net>
Diffstat (limited to 'epan/dissectors')
-rw-r--r-- | epan/dissectors/packet-tcp.c | 10 |
1 files changed, 6 insertions, 4 deletions
diff --git a/epan/dissectors/packet-tcp.c b/epan/dissectors/packet-tcp.c index de4f725bf7..418f78e8f4 100644 --- a/epan/dissectors/packet-tcp.c +++ b/epan/dissectors/packet-tcp.c @@ -1966,8 +1966,9 @@ mptcp_add_analysis_subtree(packet_info *pinfo, tvbuff_t *tvb, proto_tree *parent proto_item *item; proto_tree *tree; - DISSECTOR_ASSERT(mptcpd != NULL); - + if(mptcpd == NULL) { + return; + } item=proto_tree_add_item(parent_tree, hf_mptcp_analysis, tvb, 0, 0, ENC_NA); PROTO_ITEM_SET_GENERATED(item); @@ -3545,8 +3546,9 @@ dissect_tcpopt_mptcp(const ip_tcp_opt *optp _U_, tvbuff_t *tvb, break; } - DISSECTOR_ASSERT(mptcpd); - DISSECTOR_ASSERT(tcpd->mptcp_analysis); + if(!mptcpd || !tcpd->mptcp_analysis) { + return; + } /* if mptcpd just got allocated, remember the initial addresses * which will serve as identifiers for the conversation filter |