summaryrefslogtreecommitdiff
path: root/epan/show_exception.c
diff options
context:
space:
mode:
authorEvan Huus <eapache@gmail.com>2013-03-02 16:39:56 +0000
committerEvan Huus <eapache@gmail.com>2013-03-02 16:39:56 +0000
commitb20db86a6f3cd5ae20df18a2a3affa8ba62ede5c (patch)
tree1107a76aa9d8020a447c8e027e2443cbe9f9d130 /epan/show_exception.c
parent105dbc40273028cd3acbb9da8fe740536fd374a7 (diff)
downloadwireshark-b20db86a6f3cd5ae20df18a2a3affa8ba62ede5c.tar.gz
Define a new exception for reassembly errors, and throw it in several cases
instead of using DISSECTOR_ASSERT. When a dissector passes bad data to the reassembly machine, that isn't necessarily the dissector's fault - the data may come straight from the packet, and the dissector may not have enough information to know it's bad without telling the reassembly machine in the first place. Also fix a bug in the reassembly machine. If it were given a fragment and all of the following conditions were met: - the other associated fragments were already marked as done (reassembled) - the fragment went beyond the end of the conceptual reassembled buffer - the dissector had not set the PARTIAL_REASSEMBLY flag then the reassembly machine would incorrectly think there was an overlap and run past the end of the already-reassembled buffer. Should fix the rest of https://bugs.wireshark.org/bugzilla/show_bug.cgi?id=8380 #BACKPORT This is probably too big and intrusive to backport directly, and parts of it will need adapting anyways since reassemble.c has changed. But the bug exists and crashes in 1.6 and 1.8, so we'll have to do something. svn path=/trunk/; revision=48011
Diffstat (limited to 'epan/show_exception.c')
-rw-r--r--epan/show_exception.c17
1 files changed, 17 insertions, 0 deletions
diff --git a/epan/show_exception.c b/epan/show_exception.c
index 68e061eb67..ddc41bff85 100644
--- a/epan/show_exception.c
+++ b/epan/show_exception.c
@@ -109,6 +109,23 @@ show_exception(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree,
dissector_error_nomsg : exception_message);
break;
+ case ReassemblyError:
+ col_append_fstr(pinfo->cinfo, COL_INFO,
+ "[Reassembly error, protocol %s: %s]",
+ pinfo->current_proto,
+ exception_message == NULL ?
+ dissector_error_nomsg : exception_message);
+ item = proto_tree_add_protocol_format(tree, proto_malformed, tvb, 0, 0,
+ "[Reassembly error, protocol %s: %s]",
+ pinfo->current_proto,
+ exception_message == NULL ?
+ dissector_error_nomsg : exception_message);
+ expert_add_info_format(pinfo, item, PI_MALFORMED, PI_ERROR,
+ "%s",
+ exception_message == NULL ?
+ dissector_error_nomsg : exception_message);
+ break;
+
default:
/* XXX - we want to know, if an unknown exception passed until here, don't we? */
g_assert_not_reached();