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.
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 */
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) {
offset += (gint) (next_token - line);
linelen -= (int) (next_token - line);
- line = next_token;
-
}
/*
/*
* 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.
tvb_format_text(tvb, offset, next_offset - offset));
offset = next_offset;
}
- }
+ }
}
static gboolean response_is_continuation(const guchar *data)