diff options
author | Stig Bjørlykke <stig@bjorlykke.org> | 2008-10-11 16:01:48 +0000 |
---|---|---|
committer | Stig Bjørlykke <stig@bjorlykke.org> | 2008-10-11 16:01:48 +0000 |
commit | 9a50932bcf187085ec412b9c468dff7b12bd40a7 (patch) | |
tree | c7c591189008c7001329221b7fd7c116b475fc8a /epan | |
parent | 426f90cbe9f75383636671bb29fa8db28f36bfe3 (diff) |
From Ward van Wanrooij (bug 2955):
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.
svn path=/trunk/; revision=26419
Diffstat (limited to 'epan')
-rw-r--r-- | epan/dissectors/packet-smtp.c | 11 |
1 files changed, 7 insertions, 4 deletions
diff --git a/epan/dissectors/packet-smtp.c b/epan/dissectors/packet-smtp.c index e1e018191a..8dcbac78f3 100644 --- a/epan/dissectors/packet-smtp.c +++ b/epan/dissectors/packet-smtp.c @@ -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); |