diff options
author | Martin Kaiser <wireshark@kaiser.cx> | 2014-04-03 23:09:36 +0200 |
---|---|---|
committer | Martin Kaiser <wireshark@kaiser.cx> | 2014-04-06 11:06:32 +0000 |
commit | 4a00ef22e3dedc65669b255f33cbf0348a2464f4 (patch) | |
tree | 61e5ef4089dc432add458a9ba2edc716310ef68b /epan | |
parent | 16f2aadfc50296db4a3b071e95ca0b753eef7d25 (diff) |
make sure that we always finalize the composite setup_tvb
this should contribute to fix bug 9949
Change-Id: I5235a14b5603ac22c41dd38fb405409c066c9444
Reviewed-on: https://code.wireshark.org/review/952
Reviewed-by: Martin Kaiser <wireshark@kaiser.cx>
Diffstat (limited to 'epan')
-rw-r--r-- | epan/dissectors/packet-usb.c | 22 |
1 files changed, 13 insertions, 9 deletions
diff --git a/epan/dissectors/packet-usb.c b/epan/dissectors/packet-usb.c index 48762c4915..4eb2a901fd 100644 --- a/epan/dissectors/packet-usb.c +++ b/epan/dissectors/packet-usb.c @@ -3040,18 +3040,22 @@ dissect_usb_common(tvbuff_t *tvb, packet_info *pinfo, proto_tree *parent, } if (type_2 != RQT_SETUP_TYPE_STANDARD) { - if (setup_tvb && tvb_reported_length_remaining(tvb, offset) != 0) { - next_tvb = tvb_new_subset_remaining(tvb, offset); - tvb_composite_append(setup_tvb, next_tvb); - tvb_composite_finalize(setup_tvb); + if (setup_tvb) { + if (tvb_reported_length_remaining(tvb, offset) != 0) { + next_tvb = tvb_new_subset_remaining(tvb, offset); + tvb_composite_append(setup_tvb, next_tvb); + tvb_composite_finalize(setup_tvb); - next_tvb = tvb_new_child_real_data(tvb, (const guint8 *) tvb_memdup(pinfo->pool, setup_tvb, 0, tvb_length(setup_tvb)), tvb_length(setup_tvb), tvb_length(setup_tvb)); - add_new_data_source(pinfo, next_tvb, "Linux USB Control"); + next_tvb = tvb_new_child_real_data(tvb, (const guint8 *) tvb_memdup(pinfo->pool, setup_tvb, 0, tvb_length(setup_tvb)), tvb_length(setup_tvb), tvb_length(setup_tvb)); + add_new_data_source(pinfo, next_tvb, "Linux USB Control"); - proto_tree_add_item(setup_tree, hf_usb_data_fragment, tvb, offset, -1, ENC_NA); - } else if (!setup_tvb) { - next_tvb = tvb_new_subset_remaining(tvb, offset - 7); + proto_tree_add_item(setup_tree, hf_usb_data_fragment, tvb, offset, -1, ENC_NA); + } + else + tvb_composite_finalize(setup_tvb); } + else + next_tvb = tvb_new_subset_remaining(tvb, offset - 7); offset = try_dissect_next_protocol(tree, parent, next_tvb, offset, pinfo, usb_conv_info, type, type_2, urb_type, bus_id, device_address, NULL, NULL); } |