aboutsummaryrefslogtreecommitdiffstats
path: root/epan/dissectors
diff options
context:
space:
mode:
authorGuy Harris <guy@alum.mit.edu>2019-02-27 13:09:09 -0800
committerGuy Harris <guy@alum.mit.edu>2019-02-27 21:11:20 +0000
commit179d872565be0c7b265397ec639d49aec4e23511 (patch)
treefe7dabbafc3297125bb7db4d2048c16cca59ade7 /epan/dissectors
parentec6cdc81bd07687d4e127435b1d5f147c35e84ca (diff)
Fix subset-tvbuff creation.
Use tvb_new_subset_length(), rather than (incorrectly) attempting to calculate the captured length ourselves. Change-Id: I9f608ee5bf59f261111b2a75900dddad12fb5554 Reviewed-on: https://code.wireshark.org/review/32245 Reviewed-by: Guy Harris <guy@alum.mit.edu>
Diffstat (limited to 'epan/dissectors')
-rw-r--r--epan/dissectors/packet-ieee802154.c6
1 files changed, 2 insertions, 4 deletions
diff --git a/epan/dissectors/packet-ieee802154.c b/epan/dissectors/packet-ieee802154.c
index bb9d2fbdbe..a0f2d5c53a 100644
--- a/epan/dissectors/packet-ieee802154.c
+++ b/epan/dissectors/packet-ieee802154.c
@@ -2191,8 +2191,7 @@ ieee802154_decrypt_payload(tvbuff_t *tvb, guint mhr_len, packet_info *pinfo, pro
if (!payload_tvb) {
/* Deal with possible truncation and the MIC and FCS fields at the end. */
gint reported_len = tvb_reported_length(tvb)-mhr_len-rx_mic_len-ieee802154_fcs_len;
- gint captured_len = tvb_captured_length(tvb)-mhr_len;
- payload_tvb = tvb_new_subset_length_caplen(tvb, mhr_len, MIN(captured_len, reported_len), reported_len);
+ payload_tvb = tvb_new_subset_length(tvb, mhr_len, reported_len);
}
/* Display the MIC. */
@@ -2255,8 +2254,7 @@ ieee802154_decrypt_payload(tvbuff_t *tvb, guint mhr_len, packet_info *pinfo, pro
else {
/* Deal with possible truncation and the MIC and FCS fields at the end. */
gint reported_len = tvb_reported_length(tvb)-mhr_len-ieee802154_fcs_len;
- gint captured_len = tvb_captured_length(tvb)-mhr_len;
- payload_tvb = tvb_new_subset_length_caplen(tvb, mhr_len, MIN(captured_len, reported_len), reported_len);
+ payload_tvb = tvb_new_subset_length(tvb, mhr_len, reported_len);
}
return payload_tvb;