Don't try checksumming if we didn't capture all the data to be checksummed.

Check the captured length as well as the reported length, as is done in
other checksumming code paths.

Change-Id: I55371d99a28ffd1325e7266037cced580077d80b
Reviewed-on: https://code.wireshark.org/review/8272
Reviewed-by: Guy Harris <guy@alum.mit.edu>
This commit is contained in:
Guy Harris 2015-05-02 02:56:31 -07:00
parent 27e480cf5a
commit 44d16019a2
1 changed files with 4 additions and 2 deletions

View File

@ -374,7 +374,8 @@ dissect_pimv1(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void* data _U
pim_length = length;
}
if (!pinfo->fragmented && length >= pim_length) {
if (!pinfo->fragmented && length >= pim_length &&
tvb_captured_length(tvb) >= pim_length) {
/*
* The packet isn't part of a fragmented datagram and isn't
* truncated, so we can checksum it.
@ -864,7 +865,8 @@ dissect_pim(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree) {
*/
pim_length = length;
}
if (!pinfo->fragmented && length >= pim_length) {
if (!pinfo->fragmented && length >= pim_length &&
tvb_captured_length(tvb) >= pim_length) {
/*
* The packet isn't part of a fragmented datagram and isn't
* truncated, so we can checksum it.