aboutsummaryrefslogtreecommitdiffstats
path: root/epan
diff options
context:
space:
mode:
authorPascal Quantin <pascal.quantin@gmail.com>2015-05-11 23:46:17 +0200
committerMichael Mann <mmann78@netscape.net>2015-05-12 11:35:40 +0000
commitcc3a66a3098fa5ee66cccd9bf76c170b760b2119 (patch)
tree962065f8e9b718660378c8e9f58de17ae388aa71 /epan
parentd3dbb2b33ac2d81d0cf82d40f12af8e5294eb4fa (diff)
MBIM: fix dissection of captures taken on a Linux host
- ensure that MBIM tree is not below URB setup one - do not try to dissect an empty tvb Change-Id: I8c6655727eec7df84882fd861d5581848340e0f3 Reviewed-on: https://code.wireshark.org/review/8410 Reviewed-by: Pascal Quantin <pascal.quantin@gmail.com> Petri-Dish: Pascal Quantin <pascal.quantin@gmail.com> Tested-by: Petri Dish Buildbot <buildbot-no-reply@wireshark.org> Reviewed-by: Michael Mann <mmann78@netscape.net>
Diffstat (limited to 'epan')
-rw-r--r--epan/dissectors/packet-mbim.c3
-rw-r--r--epan/dissectors/packet-usb-com.c4
2 files changed, 6 insertions, 1 deletions
diff --git a/epan/dissectors/packet-mbim.c b/epan/dissectors/packet-mbim.c
index bc9fb6e2c2..be1aad207f 100644
--- a/epan/dissectors/packet-mbim.c
+++ b/epan/dissectors/packet-mbim.c
@@ -3660,6 +3660,7 @@ dissect_mbim_control(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void *
if ((usb_trans_info->setup.request == 0x00) && (USB_HEADER_IS_LINUX(usb_trans_info->header_type))) {
/* Skip Send Encapsulated Command header */
offset += 7;
+ tree = proto_tree_get_parent_tree(tree);
}
}
@@ -4943,7 +4944,7 @@ dissect_mbim_decode_as(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void
usb_conv_info_t *usb_conv_info;
usb_trans_info_t *usb_trans_info;
- if (!data) {
+ if (!data || (tvb_reported_length(tvb) == 0)) {
return 0;
}
diff --git a/epan/dissectors/packet-usb-com.c b/epan/dissectors/packet-usb-com.c
index 15dc7c0d1b..e41e1dc7a7 100644
--- a/epan/dissectors/packet-usb-com.c
+++ b/epan/dissectors/packet-usb-com.c
@@ -463,6 +463,10 @@ dissect_usb_com_control(tvbuff_t *tvb, packet_info *pinfo, proto_tree *setup_tre
gint offset = 0;
gboolean is_request;
+ if (tvb_reported_length(tvb) == 0) {
+ return 0;
+ }
+
col_set_str(pinfo->cinfo, COL_PROTOCOL, "USBCOM");
tree = proto_tree_get_parent_tree(setup_tree);