diff options
author | guy <guy@f5534014-38df-0310-8fa8-9805f1628bb7> | 2008-11-27 20:11:59 +0000 |
---|---|---|
committer | guy <guy@f5534014-38df-0310-8fa8-9805f1628bb7> | 2008-11-27 20:11:59 +0000 |
commit | 75266201e5406c20dad4275b5b76979a4d308d59 (patch) | |
tree | f49ce86ae396658080d318de84a7b230bb183248 /epan/dissectors/packet-usb.c | |
parent | 732318fffc80a0bdafadd4d12b89c2a6c7fe59cb (diff) |
Don't make the pseudo-header fields look as if they're part of the USB
data; at best, that can be a bit confusing, and, at worst, if the field
isn't long enough, or the offset is wrong, it can cause an exception to
be thrown and the dissection to fail.
git-svn-id: http://anonsvn.wireshark.org/wireshark/trunk@26868 f5534014-38df-0310-8fa8-9805f1628bb7
Diffstat (limited to 'epan/dissectors/packet-usb.c')
-rw-r--r-- | epan/dissectors/packet-usb.c | 12 |
1 files changed, 5 insertions, 7 deletions
diff --git a/epan/dissectors/packet-usb.c b/epan/dissectors/packet-usb.c index 8a487eb1a1..6896bf02c9 100644 --- a/epan/dissectors/packet-usb.c +++ b/epan/dissectors/packet-usb.c @@ -1230,13 +1230,13 @@ dissect_linux_usb_pseudo_header(tvbuff_t *tvb, packet_info *pinfo, proto_tree *t */ if (pinfo->pseudo_header->linux_usb.setup_flag == 0) { proto_tree_add_string_format_value(tree, hf_usb_setup_flag, tvb, - 0, sizeof(struct usb_device_setup_hdr), + 0, 0, &(pinfo->pseudo_header->linux_usb.setup_flag), "present (%d)", pinfo->pseudo_header->linux_usb.setup_flag); } else { proto_tree_add_string_format_value(tree, hf_usb_setup_flag, tvb, - 0, sizeof(struct usb_device_setup_hdr), + 0, 0, &(pinfo->pseudo_header->linux_usb.setup_flag), "not present ('%c')", pinfo->pseudo_header->linux_usb.setup_flag); @@ -1244,13 +1244,13 @@ dissect_linux_usb_pseudo_header(tvbuff_t *tvb, packet_info *pinfo, proto_tree *t if (pinfo->pseudo_header->linux_usb.data_flag == 0) { proto_tree_add_string_format_value(tree, hf_usb_data_flag, tvb, - sizeof(struct usb_device_setup_hdr), -1, + 0, 0, &(pinfo->pseudo_header->linux_usb.data_flag), "present (%d)", pinfo->pseudo_header->linux_usb.data_flag); } else { proto_tree_add_string_format_value(tree, hf_usb_data_flag, tvb, - sizeof(struct usb_device_setup_hdr), -1, + 0, 0, &(pinfo->pseudo_header->linux_usb.data_flag), "not present ('%c')", pinfo->pseudo_header->linux_usb.data_flag); @@ -1268,9 +1268,7 @@ dissect_linux_usb_pseudo_header(tvbuff_t *tvb, packet_info *pinfo, proto_tree *t proto_tree_add_uint(tree, hf_usb_urb_len, tvb, 0, 0, pinfo->pseudo_header->linux_usb.urb_len); - proto_tree_add_uint(tree, hf_usb_data_len, tvb, - sizeof(struct usb_device_setup_hdr), - pinfo->pseudo_header->linux_usb.data_len, + proto_tree_add_uint(tree, hf_usb_data_len, tvb, 0, 0, pinfo->pseudo_header->linux_usb.data_len); } |