aboutsummaryrefslogtreecommitdiffstats
path: root/epan
diff options
context:
space:
mode:
authorGuy Harris <guy@alum.mit.edu>2005-08-18 07:09:43 +0000
committerGuy Harris <guy@alum.mit.edu>2005-08-18 07:09:43 +0000
commit2831a51832dcfcaaad634fa94623c32ac147c24d (patch)
tree54ca73076a7e4a62da046bec5eaa0392acb71c2a /epan
parent880ef5343a648ef3b8ff5737ef0b68d9306d3977 (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. svn path=/trunk/; revision=15401
Diffstat (limited to 'epan')
-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);
}
}
}