From 237ac189038bb31d65fe40a98c154b255810e302 Mon Sep 17 00:00:00 2001 From: Guy Harris Date: Thu, 27 Nov 2008 20:11:59 +0000 Subject: [PATCH] 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. svn path=/trunk/; revision=26868 --- epan/dissectors/packet-usb.c | 12 +++++------- 1 file 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); }