aboutsummaryrefslogtreecommitdiffstats
path: root/packet-smtp.c
diff options
context:
space:
mode:
authorGuy Harris <guy@alum.mit.edu>2003-06-10 05:45:33 +0000
committerGuy Harris <guy@alum.mit.edu>2003-06-10 05:45:33 +0000
commiteab7ed158bbec1c30bacc6cef071cd762b5ed174 (patch)
treefc9a82380fb83e70de9e127eba83d7dbe736a5c6 /packet-smtp.c
parent43189e4e44914427ae8f17ada58a09110290ac39 (diff)
When checking for a CR-LF at the end of a packet, don't assume we have
all the data in the packet - we might have captured with a snaplen insufficient to get it all. svn path=/trunk/; revision=7825
Diffstat (limited to 'packet-smtp.c')
-rw-r--r--packet-smtp.c7
1 files changed, 5 insertions, 2 deletions
diff --git a/packet-smtp.c b/packet-smtp.c
index c52e112a4c..58d59b914e 100644
--- a/packet-smtp.c
+++ b/packet-smtp.c
@@ -1,7 +1,7 @@
/* packet-smtp.c
* Routines for SMTP packet disassembly
*
- * $Id: packet-smtp.c,v 1.32 2002/08/28 21:00:34 jmayer Exp $
+ * $Id: packet-smtp.c,v 1.33 2003/06/10 05:45:33 guy Exp $
*
* Copyright (c) 2000 by Richard Sharpe <rsharpe@ns.aus.com>
*
@@ -116,6 +116,7 @@ dissect_smtp(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree)
const guchar *line;
guint32 code;
int linelen;
+ gint length_remaining;
gboolean eom_seen = FALSE;
gint next_offset;
gboolean is_continuation_line;
@@ -226,7 +227,9 @@ dissect_smtp(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree)
}
- if (tvb_strneql(tvb, offset + tvb_length_remaining(tvb, offset) - 2, "\r\n", 2) == 0) {
+ length_remaining = tvb_length_remaining(tvb, offset);
+ if (length_remaining == tvb_reported_length_remaining(tvb, offset) &&
+ tvb_strneql(tvb, offset + length_remaining - 2, "\r\n", 2) == 0) {
request_val->crlf_seen = 1;