diff options
author | Anders Broman <anders.broman@ericsson.com> | 2007-08-09 12:17:56 +0000 |
---|---|---|
committer | Anders Broman <anders.broman@ericsson.com> | 2007-08-09 12:17:56 +0000 |
commit | 6c161ff927d7683f8fb8f20486fd5127b48bd0fd (patch) | |
tree | 7cc5518e9ae6580d771506ecba78588f61b1fd7c /epan | |
parent | 171efad2b803e57484e2e500e23f994867dfdb86 (diff) |
Packet-imf.c - Offset must be advanced to AFTER CRLF(CRLF).
packet-multipart.c - imf_find_field_end()'s maxlength is last offset in tvb.
svn path=/trunk/; revision=22476
Diffstat (limited to 'epan')
-rw-r--r-- | epan/dissectors/packet-imf.c | 49 | ||||
-rw-r--r-- | epan/dissectors/packet-multipart.c | 8 |
2 files changed, 29 insertions, 28 deletions
diff --git a/epan/dissectors/packet-imf.c b/epan/dissectors/packet-imf.c index 307cf0cf90..c9a97daf0d 100644 --- a/epan/dissectors/packet-imf.c +++ b/epan/dissectors/packet-imf.c @@ -427,31 +427,30 @@ int imf_find_field_end(tvbuff_t *tvb, int offset, gint max_length, gboolean *las if(offset != -1) { if(tvb_get_guint8(tvb, ++offset) == '\n') { - - /* OK - so we have found CRLF */ - /* peek the next character */ - - switch(tvb_get_guint8(tvb, ++offset)) { - case '\r': - /* probably end of the fields */ - if(last_field) - *last_field = TRUE; - return offset; - break; - case ' ': - case '\t': - /* continuation line */ - break; - default: - /* this is a new field */ - return offset; - break; - } - } - } else { - - /* couldn't find a CR - strange */ - return offset; + /* OK - so we have found CRLF */ + /* peek the next character */ + switch(tvb_get_guint8(tvb, ++offset)) { + case '\r': + /* probably end of the fields */ + if(tvb_get_guint8(tvb, ++offset) == '\n') + offset++; + if(last_field) + *last_field = TRUE; + return offset; + break; + case ' ': + case '\t': + /* continuation line */ + break; + default: + /* this is a new field */ + return offset; + break; + } + } + }else { + /* couldn't find a CR - strange */ + return offset; } } diff --git a/epan/dissectors/packet-multipart.c b/epan/dissectors/packet-multipart.c index 14ab2627c0..a71b69f295 100644 --- a/epan/dissectors/packet-multipart.c +++ b/epan/dissectors/packet-multipart.c @@ -29,7 +29,7 @@ * * References for "media-type multipart/mixed : * http://www.iana.org/assignments/media-types/index.html - * http://www.rfc-editor.org/rfc/rfc2045.txt + * http://www.ietf.org/rfc/rfc2045.txt?number=2045 * http://www.rfc-editor.org/rfc/rfc2046.txt * http://www.rfc-editor.org/rfc/rfc2047.txt * http://www.rfc-editor.org/rfc/rfc2048.txt @@ -622,8 +622,10 @@ process_body_part(proto_tree *tree, tvbuff_t *tvb, const guint8 *boundary, char *hdr_str; char *header_str; - /* Look for the end of the header (denoted by cr) */ - next_offset = imf_find_field_end(tvb, offset, tvb_length_remaining(tvb, offset), &last_field); + /* Look for the end of the header (denoted by cr) + * 3:d argument to imf_find_field_end() maxlen; must be last offset in the tvb. + */ + next_offset = imf_find_field_end(tvb, offset, tvb_length_remaining(tvb, offset)+offset, &last_field); /* If cr not found, won't have advanced - get out to avoid infinite loop! */ if (next_offset == offset) { break; |