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
This commit is contained in:
Guy Harris 2005-08-18 07:09:43 +00:00
parent 880ef5343a
commit 2831a51832
1 changed files with 7 additions and 6 deletions

View File

@ -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);
}
}
}