diff options
author | guy <guy@f5534014-38df-0310-8fa8-9805f1628bb7> | 2005-08-18 07:09:43 +0000 |
---|---|---|
committer | guy <guy@f5534014-38df-0310-8fa8-9805f1628bb7> | 2005-08-18 07:09:43 +0000 |
commit | beae8ca19138c1745594a64a158dd4b4d120de03 (patch) | |
tree | 54ca73076a7e4a62da046bec5eaa0392acb71c2a | |
parent | 12cd7897d3bffc136f47052a2125817eaf075763 (diff) |
The length returned for continuation data should be the length remaining
in the tvbuff starting at the specified offset, not the entire length of
the tvbuff.
git-svn-id: http://anonsvn.wireshark.org/wireshark/trunk@15401 f5534014-38df-0310-8fa8-9805f1628bb7
-rw-r--r-- | epan/dissectors/packet-bittorrent.c | 13 |
1 files changed, 7 insertions, 6 deletions
diff --git a/epan/dissectors/packet-bittorrent.c b/epan/dissectors/packet-bittorrent.c index c62822bb89..66b0854115 100644 --- a/epan/dissectors/packet-bittorrent.c +++ b/epan/dissectors/packet-bittorrent.c @@ -153,17 +153,18 @@ static guint get_bittorrent_pdu_length(tvbuff_t *tvb, int offset) /* The type is not known, so this message cannot be decoded properly by this dissector. We assume it's continuation data from the middle of a message, and just return the - length of the tvbuff so the entire tvbuff is displayed - as continuation data. */ - return tvb_length(tvb); + remaining length in the tvbuff so the rest of the tvbuff + is displayed as continuation data. */ + return tvb_length_remaining(tvb, offset); } } else { /* We don't have the type field, so we can't determine whether this is a valid message. For now, we assume it's continuation data from the middle of a message, - and just return the length of the tvbuff so the entire - tvbuff is displayed as continuation data. */ - return tvb_length(tvb); + and just return the remaining length in the tvbuff so + the rest of the tvbuff is displayed as continuation + data. */ + return tvb_length_remaining(tvb, offset); } } } |