diff options
author | Gerald Combs <gerald@wireshark.org> | 2009-08-04 17:59:48 +0000 |
---|---|---|
committer | Gerald Combs <gerald@wireshark.org> | 2009-08-04 17:59:48 +0000 |
commit | 49c58bc1a4c359e523bd0a1dddb2a72a4a8cff7d (patch) | |
tree | 18ce12f62d5e0124c5a04a274317cce31ff6073e | |
parent | fef272347b8966bfefaac8a632271777591419e3 (diff) |
Miscellaneous cleanups.
svn path=/trunk/; revision=29291
-rw-r--r-- | epan/dissectors/packet-pop.c | 18 |
1 files changed, 7 insertions, 11 deletions
diff --git a/epan/dissectors/packet-pop.c b/epan/dissectors/packet-pop.c index f1a960eab3..4dc10b809f 100644 --- a/epan/dissectors/packet-pop.c +++ b/epan/dissectors/packet-pop.c @@ -133,8 +133,7 @@ dissect_pop(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree) struct pop_data_val *data_val = NULL; gint length_remaining; - if (check_col(pinfo->cinfo, COL_PROTOCOL)) - col_set_str(pinfo->cinfo, COL_PROTOCOL, "POP"); + col_set_str(pinfo->cinfo, COL_PROTOCOL, "POP"); /* * Find the end of the first line. @@ -241,7 +240,7 @@ dissect_pop(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree) if(next_tvb) { if(imf_handle) - call_dissector(imf_handle, next_tvb, pinfo, tree); + call_dissector(imf_handle, next_tvb, pinfo, tree); if(data_val) { /* we have read everything - reset */ @@ -292,12 +291,12 @@ dissect_pop(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree) if(is_request) { /* see if this is RETR or TOP command */ - if((g_ascii_strncasecmp(line, "RETR", 4) == 0) || - (g_ascii_strncasecmp(line, "TOP", 3) == 0)) + if(data_val && ((g_ascii_strncasecmp(line, "RETR", 4) == 0) || + (g_ascii_strncasecmp(line, "TOP", 3) == 0))) /* the next response will tell us how many bytes */ data_val->msg_request = TRUE; } else { - if(data_val->msg_request) { + if(data_val && data_val->msg_request) { /* this is a response to a RETR or TOP command */ if(g_ascii_strncasecmp(line, "+OK ", 4) == 0) { @@ -311,8 +310,6 @@ dissect_pop(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree) offset += (gint) (next_token - line); linelen -= (int) (next_token - line); - line = next_token; - } /* @@ -336,8 +333,7 @@ dissect_pop(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree) /* * Find the end of the line. */ - linelen = tvb_find_line_end(tvb, offset, -1, - &next_offset, FALSE); + tvb_find_line_end(tvb, offset, -1, &next_offset, FALSE); /* * Put this line. @@ -352,7 +348,7 @@ dissect_pop(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree) tvb_format_text(tvb, offset, next_offset - offset)); offset = next_offset; } - } + } } static gboolean response_is_continuation(const guchar *data) |