diff options
author | Pascal Quantin <pascal.quantin@gmail.com> | 2015-02-10 13:49:28 +0100 |
---|---|---|
committer | Pascal Quantin <pascal.quantin@gmail.com> | 2015-02-10 14:02:20 +0000 |
commit | e915db7cc8c779368afef51c12241337b4d7beda (patch) | |
tree | 0cf7356cb71db4ba4ed95448bc5113a2aabd6682 /epan/dissectors/packet-memcache.c | |
parent | 7369c25ad41ef075688420f53f353e8e6c4ddfdb (diff) |
Do not iterate over reported length when using tvb_find_line_end
if captured length < reported length, this will trigger an infinite loop
Change-Id: I6557b455e7bbff12658a934e5bb13a42c023e133
Reviewed-on: https://code.wireshark.org/review/7053
Petri-Dish: Pascal Quantin <pascal.quantin@gmail.com>
Tested-by: Petri Dish Buildbot <buildbot-no-reply@wireshark.org>
Reviewed-by: Michael Mann <mmann78@netscape.net>
Reviewed-by: Pascal Quantin <pascal.quantin@gmail.com>
Diffstat (limited to 'epan/dissectors/packet-memcache.c')
-rw-r--r-- | epan/dissectors/packet-memcache.c | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/epan/dissectors/packet-memcache.c b/epan/dissectors/packet-memcache.c index 38fe389ea6..b969d3c47d 100644 --- a/epan/dissectors/packet-memcache.c +++ b/epan/dissectors/packet-memcache.c @@ -1003,7 +1003,7 @@ incr_dissector (tvbuff_t *tvb, proto_tree *tree, int offset) int tokenlen; /* expecting to read 'bytes' number of bytes from the buffer. */ - if (tvb_reported_length_remaining (tvb, offset) != 0) { + if (tvb_offset_exists (tvb, offset)) { /* Find the end of the line. */ linelen = tvb_find_line_end (tvb, offset, tvb_ensure_length_remaining (tvb, offset), &next_offset, @@ -1054,7 +1054,7 @@ stat_dissector (tvbuff_t *tvb, proto_tree *tree, int offset) guint32 slabclass; guchar response_chars[21]; - while (tvb_reported_length_remaining (tvb, offset) != 0) { + while (tvb_offset_exists (tvb, offset)) { /* Find the end of the line. */ linelen = tvb_find_line_end (tvb, offset, tvb_ensure_length_remaining (tvb, offset), &next_offset, @@ -1167,7 +1167,7 @@ get_response_dissector (tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, int gchar response_chars[21]; /* cover uint64 (20 + 1) bytes*/ /* expecting to read 'bytes' number of bytes from the buffer. */ - while (tvb_reported_length_remaining (tvb, offset) != 0) { + while (tvb_offset_exists (tvb, offset)) { /* Find the end of the line. */ linelen = tvb_find_line_end (tvb, offset, tvb_ensure_length_remaining (tvb, offset), &next_offset, |