From Ward van Wanrooij (bug 2955):
authorstig <stig@f5534014-38df-0310-8fa8-9805f1628bb7>
Sat, 11 Oct 2008 16:01:48 +0000 (16:01 +0000)
committerstig <stig@f5534014-38df-0310-8fa8-9805f1628bb7>
Sat, 11 Oct 2008 16:01:48 +0000 (16:01 +0000)
Add the fragment to the defragmentation sequence if the SMTP dissector
encouters a packet that contains both a DATA fragment and the terminating
\r\n.\r\n sequence.

git-svn-id: http://anonsvn.wireshark.org/wireshark/trunk@26419 f5534014-38df-0310-8fa8-9805f1628bb7

AUTHORS
epan/dissectors/packet-smtp.c

diff --git a/AUTHORS b/AUTHORS
index 90a72e9477d6ea0b5d046a926bc19e78ec86217d..ecf1b9230a00e36ab453e154648bc361300cd097 100644 (file)
--- a/AUTHORS
+++ b/AUTHORS
@@ -2930,6 +2930,7 @@ David Aggeler             <david_aggeler [AT] hispeed.ch>
 Magnus Sörman         <magnus.sorman [AT] ericsson.com
 Pascal Quantin         <pascal.quantin [AT] gmail.com>
 Roy Marples            <roy [AT] marples.name>
+Ward van Wanrooij      <ward [AT] ward.nu>
 
 Alain Magloire <alainm[AT]rcsm.ece.mcgill.ca> was kind enough to
 give his permission to use his version of snprintf.c.
index e1e018191a558ef55def4333074e60bdd9621e62..8dcbac78f3781759a3c57a5eef5b248e997d572b 100644 (file)
@@ -229,7 +229,7 @@ dissect_smtp(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree)
     gint                      length_remaining;
     gboolean                  eom_seen = FALSE;
     gint                      next_offset;
-    gint                      loffset;
+    gint                      loffset = 0;
     gboolean                  is_continuation_line;
     int                       cmdlen;
     fragment_data             *frag_msg = NULL;
@@ -380,9 +380,6 @@ dissect_smtp(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree)
               /*
                * EOM.
                * Everything that comes after it is commands.
-               *
-               * XXX - what if the EOM isn't at the beginning of
-               * the TCP segment?  It can occur anywhere....
                */
               frame_data->pdu_type = SMTP_PDU_EOM;
               session_state->smtp_state = READING_CMDS;
@@ -638,6 +635,12 @@ dissect_smtp(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree)
           proto_tree_add_text(smtp_tree, tvb, offset, linelen, "C: .");
 
           if (smtp_data_desegment) {
+            /* add final data segment */
+            if (loffset)
+              fragment_add_seq_next(tvb, 0, pinfo, frame_data->conversation_id,
+                                    smtp_data_segment_table, smtp_data_reassembled_table,
+                                    loffset, frame_data->more_frags);
+
             /* terminate the desegmentation */
             frag_msg = fragment_end_seq_next (pinfo, frame_data->conversation_id, smtp_data_segment_table,
                                               smtp_data_reassembled_table);