aboutsummaryrefslogtreecommitdiffstats
path: root/epan/dissectors/packet-bittorrent.c
diff options
context:
space:
mode:
authorguy <guy@f5534014-38df-0310-8fa8-9805f1628bb7>2005-08-18 07:09:43 +0000
committerguy <guy@f5534014-38df-0310-8fa8-9805f1628bb7>2005-08-18 07:09:43 +0000
commitbeae8ca19138c1745594a64a158dd4b4d120de03 (patch)
tree54ca73076a7e4a62da046bec5eaa0392acb71c2a /epan/dissectors/packet-bittorrent.c
parent12cd7897d3bffc136f47052a2125817eaf075763 (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
Diffstat (limited to 'epan/dissectors/packet-bittorrent.c')
-rw-r--r--epan/dissectors/packet-bittorrent.c13
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);
}
}
}