Add a couple more in_error_pkt checks.
authorJeff Morriss <morriss@ulticom.com>
Fri, 4 Apr 2014 16:01:31 +0000 (12:01 -0400)
committerJeff Morriss <jeff.morriss.ws@gmail.com>
Sun, 6 Apr 2014 17:34:04 +0000 (17:34 +0000)
Don't attempt reassembly and squash an expert info when we're in an error
packet.

Change-Id: I7d19e4ab7add78829bf1e28ad92dce3a7431c37d
Reviewed-on: https://code.wireshark.org/review/964
Reviewed-by: Jeff Morriss <jeff.morriss.ws@gmail.com>
Tested-by: Jeff Morriss <jeff.morriss.ws@gmail.com>
epan/dissectors/packet-sctp.c

index 66cf02fc3645f033ce41db503c6474e33da70f5d..2381a5fb8bd4aaf8d64278a45ec6f5340ea01bf7 100644 (file)
@@ -2581,7 +2581,7 @@ find_fragment(guint32 tsn, guint16 stream_id, guint16 stream_seq_num)
 }
 
 
-static sctp_fragment*
+static sctp_fragment *
 add_fragment(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, guint32 tsn,
              guint16 stream_id, guint16 stream_seq_num, guint8 b_bit, guint8 e_bit)
 {
@@ -2590,6 +2590,10 @@ add_fragment(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, guint32 tsn,
   sctp_frag_be *beginend, *last_beginend;
   frag_key *key;
 
+  /* Don't try to do reassembly on error packets */
+  if (pinfo->flags.in_error_pkt)
+    return NULL;
+
   /* lookup message. if not found, create it */
   msg = find_message(stream_id, stream_seq_num);
 
@@ -4128,7 +4132,7 @@ dissect_sctp_chunk(tvbuff_t *chunk_tvb,
   }
 
   length_item = proto_tree_add_uint(chunk_tree, hf_chunk_length, chunk_tvb, CHUNK_LENGTH_OFFSET, CHUNK_LENGTH_LENGTH, length);
-  if (length > reported_length) {
+  if (length > reported_length && !pinfo->flags.in_error_pkt) {
     expert_add_info_format(pinfo, length_item, &ei_sctp_chunk_length_bad, "Chunk length (%d) is longer than remaining data (%d) in the packet.", length, reported_length);
     /* We'll almost certainly throw an exception shortly... */
   }