From 2cb5985bf47bdc8bea78d28483ed224abdd33dc6 Mon Sep 17 00:00:00 2001 From: Michael Mann Date: Sun, 1 May 2016 12:55:23 -0400 Subject: Make class "type" for USB conversations. USB dissectors can't assume that only their class type has been passed around in the conversation. Make explicit check that class type expected matches the dissector and stop/prevent dissection if there isn't a match. Bug: 12356 Change-Id: Ib23973a4ebd0fbb51952ffc118daf95e3389a209 Reviewed-on: https://code.wireshark.org/review/15212 Petri-Dish: Michael Mann Reviewed-by: Martin Kaiser Petri-Dish: Martin Kaiser Tested-by: Petri Dish Buildbot Reviewed-by: Michael Mann --- epan/dissectors/packet-usb-masstorage.c | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) (limited to 'epan/dissectors/packet-usb-masstorage.c') diff --git a/epan/dissectors/packet-usb-masstorage.c b/epan/dissectors/packet-usb-masstorage.c index 743775be72..919f7ef364 100644 --- a/epan/dissectors/packet-usb-masstorage.c +++ b/epan/dissectors/packet-usb-masstorage.c @@ -199,9 +199,12 @@ dissect_usb_ms_bulk(tvbuff_t *tvb, packet_info *pinfo, proto_tree *parent_tree, usb_ms_conv_info->itl=wmem_tree_new(wmem_file_scope()); usb_ms_conv_info->itlq=wmem_tree_new(wmem_file_scope()); usb_conv_info->class_data=usb_ms_conv_info; + usb_conv_info->class_data_type = USB_CONV_MASS_STORAGE; + } else if (usb_conv_info->class_data_type != USB_CONV_MASS_STORAGE) { + /* Don't dissect if another USB type is in the conversation */ + return 0; } - is_request=(pinfo->srcport==NO_ENDPOINT); col_set_str(pinfo->cinfo, COL_PROTOCOL, "USBMS"); -- cgit v1.2.3