aboutsummaryrefslogtreecommitdiffstats
path: root/epan/dissectors/packet-pim.c
diff options
context:
space:
mode:
authorGuy Harris <guy@alum.mit.edu>2015-05-02 02:56:31 -0700
committerGuy Harris <guy@alum.mit.edu>2015-05-02 09:57:27 +0000
commit44d16019a27f1164d16dff7fb0f5f6bd8ed89af2 (patch)
tree18ac3a4e6c18fa8642cd6adb30a4fafe69fc9970 /epan/dissectors/packet-pim.c
parent27e480cf5a29563cf2ee4ff30c8bfd31b81631f9 (diff)
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>
Diffstat (limited to 'epan/dissectors/packet-pim.c')
-rw-r--r--epan/dissectors/packet-pim.c6
1 files changed, 4 insertions, 2 deletions
diff --git a/epan/dissectors/packet-pim.c b/epan/dissectors/packet-pim.c
index a492b291d8..9c289a5fe2 100644
--- a/epan/dissectors/packet-pim.c
+++ b/epan/dissectors/packet-pim.c
@@ -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.