diff options
author | John Thacker <johnthacker@gmail.com> | 2023-09-01 20:58:01 -0400 |
---|---|---|
committer | AndersBroman <a.broman58@gmail.com> | 2023-09-02 10:19:15 +0000 |
commit | f2f7c7bf1c8ab1611541f2f1f84ee1e64423ba4a (patch) | |
tree | d7d7f602552a5e1d1cf3a1f73eb8a0a592c710e3 /epan/dissectors/packet-usb.c | |
parent | 3679783182d51ef63e4cb0694eaac81e05ea5974 (diff) |
Remove some uses of tvb_new_subset_length_caplen()
These are all very obvious what was intended, and should be
tvb_new_subset_length() or tvb_new_subset_remaining() instead.
A few of them could throw exceptions (and sometimes the wrong
exception) on packets where the captured length was not the full
reported length, but for most of these this change has no effect
(especially after commit 0c4dcc164be292790faa4707ccf06dfb6dc9dcb9)
This makes it easier to find the calls that need fixing.
Diffstat (limited to 'epan/dissectors/packet-usb.c')
-rw-r--r-- | epan/dissectors/packet-usb.c | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/epan/dissectors/packet-usb.c b/epan/dissectors/packet-usb.c index 8438b8faa0..e978fa1296 100644 --- a/epan/dissectors/packet-usb.c +++ b/epan/dissectors/packet-usb.c @@ -4320,7 +4320,7 @@ dissect_usb_setup_request(packet_info *pinfo, proto_tree *tree, if (tvb_captured_length_remaining(tvb, offset) > 0) { next_tvb = tvb_new_composite(); - tvb_composite_append(next_tvb, tvb_new_subset_length_caplen(tvb, setup_offset, 7, 7)); + tvb_composite_append(next_tvb, tvb_new_subset_length(tvb, setup_offset, 7)); data_tvb = tvb_new_subset_remaining(tvb, offset); tvb_composite_append(next_tvb, data_tvb); @@ -4332,7 +4332,7 @@ dissect_usb_setup_request(packet_info *pinfo, proto_tree *tree, tvb_captured_length(next_tvb)); add_new_data_source(pinfo, next_tvb, "USB Control"); } else { - next_tvb = tvb_new_subset_length_caplen(tvb, setup_offset, 7, 7); + next_tvb = tvb_new_subset_length(tvb, setup_offset, 7); } /* at this point, offset contains the number of bytes that we |