diff options
author | Pascal Quantin <pascal.quantin@gmail.com> | 2013-04-24 21:25:30 +0000 |
---|---|---|
committer | Pascal Quantin <pascal.quantin@gmail.com> | 2013-04-24 21:25:30 +0000 |
commit | 2dc27b8b855eecc2f93280e798e3be725707eb89 (patch) | |
tree | bd65cd4ee4aba799e6c6f561d6250efd708c8e19 /epan/dissectors | |
parent | fd13812247f8c4a6cdaa2cb141b8b739f037a8a5 (diff) |
Fix https://bugs.wireshark.org/bugzilla/show_bug.cgi?id=8610 :
Ensure that tap is called after full dissection, even in case of exception
svn path=/trunk/; revision=49019
Diffstat (limited to 'epan/dissectors')
-rw-r--r-- | epan/dissectors/packet-rtp.c | 47 |
1 files changed, 29 insertions, 18 deletions
diff --git a/epan/dissectors/packet-rtp.c b/epan/dissectors/packet-rtp.c index 0379f93af0..dbda69af70 100644 --- a/epan/dissectors/packet-rtp.c +++ b/epan/dissectors/packet-rtp.c @@ -1801,19 +1801,24 @@ dissect_rtp( tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree ) rtp_info->info_payload_len = tvb_length_remaining(tvb, offset); rtp_info->info_padding_count = padding_count; - if (!pinfo->flags.in_error_pkt) - tap_queue_packet(rtp_tap, pinfo, rtp_info); - if (data_len > 0) { /* * There's data left over when you take out * the padding; dissect it. */ - dissect_rtp_data( tvb, pinfo, tree, rtp_tree, - offset, - data_len, - data_len, - payload_type ); + /* Ensure that tap is called after packet dissection, even in case of exception */ + TRY { + dissect_rtp_data( tvb, pinfo, tree, rtp_tree, + offset, + data_len, + data_len, + payload_type ); + } CATCH_ALL { + if (!pinfo->flags.in_error_pkt) + tap_queue_packet(rtp_tap, pinfo, rtp_info); + RETHROW; + } + ENDTRY; offset += data_len; } else if (data_len < 0) { /* @@ -1848,19 +1853,25 @@ dissect_rtp( tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree ) /* * No padding. */ - rtp_info->info_payload_offset = offset; - rtp_info->info_payload_len = tvb_length_remaining(tvb, offset); - - if (!pinfo->flags.in_error_pkt) - tap_queue_packet(rtp_tap, pinfo, rtp_info); - if (tvb_reported_length_remaining(tvb, offset) > 0) { - dissect_rtp_data( tvb, pinfo, tree, rtp_tree, offset, - tvb_length_remaining( tvb, offset ), - tvb_reported_length_remaining( tvb, offset ), - payload_type ); + /* Ensure that tap is called after packet dissection, even in case of exception */ + TRY { + dissect_rtp_data( tvb, pinfo, tree, rtp_tree, offset, + tvb_length_remaining( tvb, offset ), + tvb_reported_length_remaining( tvb, offset ), + payload_type ); + } CATCH_ALL { + if (!pinfo->flags.in_error_pkt) + tap_queue_packet(rtp_tap, pinfo, rtp_info); + RETHROW; + } + ENDTRY; } + rtp_info->info_payload_offset = offset; + rtp_info->info_payload_len = tvb_length_remaining(tvb, offset); } + if (!pinfo->flags.in_error_pkt) + tap_queue_packet(rtp_tap, pinfo, rtp_info); } static void |