aboutsummaryrefslogtreecommitdiffstats
path: root/packet-pop.c
diff options
context:
space:
mode:
authorLaurent Deniel <laurent.deniel@free.fr>1999-10-03 13:44:32 +0000
committerLaurent Deniel <laurent.deniel@free.fr>1999-10-03 13:44:32 +0000
commitb6b303475e0985762b9f9d555ed49d0f0b631692 (patch)
tree495f870bb5099af00fa3dd0b244a5b6aee26f485 /packet-pop.c
parent06494664b068ca66e687ad81a22198a6dccdd34b (diff)
Fix request argument display with some pop clients
that send only '\n' instead of '\r''\n' and handle more correctly truncated packets. svn path=/trunk/; revision=761
Diffstat (limited to 'packet-pop.c')
-rw-r--r--packet-pop.c10
1 files changed, 7 insertions, 3 deletions
diff --git a/packet-pop.c b/packet-pop.c
index ec8a62bffb..4a65076a7b 100644
--- a/packet-pop.c
+++ b/packet-pop.c
@@ -2,7 +2,7 @@
* Routines for pop packet dissection
* Copyright 1999, Richard Sharpe <rsharpe@ns.aus.com>
*
- * $Id: packet-pop.c,v 1.7 1999/08/24 17:26:13 gram Exp $
+ * $Id: packet-pop.c,v 1.8 1999/10/03 13:44:32 deniel Exp $
*
* Ethereal - Network traffic analyzer
* By Gerald Combs <gerald@unicom.net>
@@ -67,6 +67,11 @@ dissect_pop(const u_char *pd, int offset, frame_data *fd, proto_tree *tree)
strncpy(rr, pd + offset, MIN(i1, sizeof(rr) - 1));
i2 = ((u_char *)strchr(pd + offset + i1 + 1, '\r') - (pd + offset)) - i1 - 1;
+ if (i2 > max_data - i1 - 1 || i2 <= 0) {
+ i2 = ((u_char *)strchr(pd + offset + i1 + 1, '\n') - (pd + offset)) - i1 - 1;
+ if (i2 > max_data - i1 - 1 || i2 <= 0)
+ i2 = max_data - i1 - 1;
+ }
strncpy(rd, pd + offset + i1 + 1, MIN(i2, sizeof(rd) - 1));
}
@@ -75,8 +80,7 @@ dissect_pop(const u_char *pd, int offset, frame_data *fd, proto_tree *tree)
if (check_col(fd, COL_INFO)) {
- col_add_fstr(fd, COL_INFO, "%s: %s %s", (pi.match_port == pi.destport)? "Request" : "Response", rr, rd);
-
+ col_add_fstr(fd, COL_INFO, "%s: %s %s", (pi.match_port == pi.destport)? "Request" : "Response", rr, rd);
}
if (tree) {