aboutsummaryrefslogtreecommitdiffstats
path: root/epan/dissectors
diff options
context:
space:
mode:
authorMartin Kaiser <wireshark@kaiser.cx>2014-08-20 14:32:40 +0200
committerMartin Kaiser <wireshark@kaiser.cx>2014-08-25 13:59:28 +0000
commitb737e2e8ef9540659d2918653fd9805a16fbb3c5 (patch)
tree612691e3939a4926ef03d32bc99fea79bac11047 /epan/dissectors
parentc284e1211296361d1548e8f98a7ccc51c621019f (diff)
remove trans_info parameter from dissect_usb_endpoint_descriptor()
(remove it in the call from mausb as well) add NULL checks for usb_conv_info, usb_trans_info Change-Id: I95d52b85e3fa0d42b6a20047053259aaca8754fe Reviewed-on: https://code.wireshark.org/review/3784 Reviewed-by: Martin Kaiser <wireshark@kaiser.cx>
Diffstat (limited to 'epan/dissectors')
-rw-r--r--epan/dissectors/packet-mausb.c2
-rw-r--r--epan/dissectors/packet-usb.c31
-rw-r--r--epan/dissectors/packet-usb.h3
3 files changed, 19 insertions, 17 deletions
diff --git a/epan/dissectors/packet-mausb.c b/epan/dissectors/packet-mausb.c
index 0e057b94c9..d9fcfcaa0e 100644
--- a/epan/dissectors/packet-mausb.c
+++ b/epan/dissectors/packet-mausb.c
@@ -892,7 +892,7 @@ static guint16 dissect_mausb_mgmt_pkt_ep_handle( proto_tree *tree, tvbuff_t *tvb
/* Standard USB Endpoint Descriptor */
dissect_usb_endpoint_descriptor(pinfo, tree, tvb, loop_offset,
- &usb_trans_info, &usb_conv_info);
+ &usb_conv_info);
loop_offset += USB_DT_EP_SIZE;
/* If there are more descriptors to read */
diff --git a/epan/dissectors/packet-usb.c b/epan/dissectors/packet-usb.c
index 35c3c01911..90fc66eece 100644
--- a/epan/dissectors/packet-usb.c
+++ b/epan/dissectors/packet-usb.c
@@ -1712,19 +1712,22 @@ void dissect_usb_endpoint_address(proto_tree *tree, tvbuff_t *tvb, int offset)
int
dissect_usb_endpoint_descriptor(packet_info *pinfo, proto_tree *parent_tree,
tvbuff_t *tvb, int offset,
- usb_trans_info_t *usb_trans_info,
- usb_conv_info_t *usb_conv_info _U_)
+ usb_conv_info_t *usb_conv_info)
{
- proto_item *item;
- proto_tree *tree;
- proto_item *ep_attrib_item;
- proto_tree *ep_attrib_tree;
- proto_item *ep_pktsize_item;
- proto_tree *ep_pktsize_tree;
- int old_offset = offset;
- guint8 endpoint;
- guint8 ep_type;
- guint8 len;
+ proto_item *item;
+ proto_tree *tree;
+ proto_item *ep_attrib_item;
+ proto_tree *ep_attrib_tree;
+ proto_item *ep_pktsize_item;
+ proto_tree *ep_pktsize_tree;
+ int old_offset = offset;
+ guint8 endpoint;
+ guint8 ep_type;
+ guint8 len;
+ usb_trans_info_t *usb_trans_info = NULL;
+
+ if (usb_conv_info)
+ usb_trans_info = usb_conv_info->usb_trans_info;
tree = proto_tree_add_subtree(parent_tree, tvb, offset, -1, ett_descriptor_device, &item, "ENDPOINT DESCRIPTOR");
@@ -1744,7 +1747,7 @@ dissect_usb_endpoint_descriptor(packet_info *pinfo, proto_tree *parent_tree,
* All endpoints for the same interface descriptor share the same
* usb_conv_info structure.
*/
- if ((!pinfo->fd->flags.visited)&&usb_trans_info->interface_info) {
+ if ((!pinfo->fd->flags.visited) && usb_trans_info && usb_trans_info->interface_info) {
conversation_t *conversation = NULL;
if (pinfo->destport == NO_ENDPOINT) {
@@ -1982,7 +1985,7 @@ dissect_usb_configuration_descriptor(packet_info *pinfo _U_, proto_tree *parent_
offset = dissect_usb_interface_descriptor(pinfo, parent_tree, tvb, offset, usb_conv_info);
break;
case USB_DT_ENDPOINT:
- offset = dissect_usb_endpoint_descriptor(pinfo, parent_tree, tvb, offset, usb_trans_info, usb_conv_info);
+ offset = dissect_usb_endpoint_descriptor(pinfo, parent_tree, tvb, offset, usb_conv_info);
break;
case USB_DT_INTERFACE_ASSOCIATION:
offset = dissect_usb_interface_assn_descriptor(pinfo, parent_tree, tvb, offset, usb_conv_info);
diff --git a/epan/dissectors/packet-usb.h b/epan/dissectors/packet-usb.h
index 3296abd46f..dccfd6c4ef 100644
--- a/epan/dissectors/packet-usb.h
+++ b/epan/dissectors/packet-usb.h
@@ -215,8 +215,7 @@ void dissect_usb_endpoint_address(proto_tree *tree, tvbuff_t *tvb, int offset);
int
dissect_usb_endpoint_descriptor(packet_info *pinfo, proto_tree *parent_tree,
tvbuff_t *tvb, int offset,
- usb_trans_info_t *usb_trans_info,
- usb_conv_info_t *usb_conv_info _U_);
+ usb_conv_info_t *usb_conv_info);
int
dissect_usb_unknown_descriptor(packet_info *pinfo _U_, proto_tree *parent_tree,