diff options
author | Chris Maynard <Christopher.Maynard@GTECH.COM> | 2013-12-09 22:23:44 +0000 |
---|---|---|
committer | Chris Maynard <Christopher.Maynard@GTECH.COM> | 2013-12-09 22:23:44 +0000 |
commit | 79fa0d0a3fa8ebb91fac92fda1274957fc55bcd4 (patch) | |
tree | 9a714a0dfd512884ae08640817e2783d528d0bf3 /epan/dissectors/packet-hci_usb.c | |
parent | e3c369eb6786e8f17e3e8ce6da027012511566b8 (diff) |
Reject the packet if data is NULL without doing anything else.
Note: We *might* want to do _something_ but that _something_ should be well-defined and consistent across all dissectors. Previously, some dissectors called proto_tree_add_text() to add some error message text to the tree, while others called DISSECTOR_ASSERT().
svn path=/trunk/; revision=53895
Diffstat (limited to 'epan/dissectors/packet-hci_usb.c')
-rw-r--r-- | epan/dissectors/packet-hci_usb.c | 9 |
1 files changed, 6 insertions, 3 deletions
diff --git a/epan/dissectors/packet-hci_usb.c b/epan/dissectors/packet-hci_usb.c index 6fdf2c08de..37be9330e6 100644 --- a/epan/dissectors/packet-hci_usb.c +++ b/epan/dissectors/packet-hci_usb.c @@ -106,13 +106,18 @@ dissect_hci_usb(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void *data) proto_tree *titem = NULL; proto_item *pitem = NULL; gint offset = 0; - usb_conv_info_t *usb_conv_info = (usb_conv_info_t *)data; + usb_conv_info_t *usb_conv_info; tvbuff_t *next_tvb = NULL; hci_data_t *hci_data; gint p2p_dir_save; guint32 session_id; fragment_head *reassembled; + /* Reject the packet if data is NULL */ + if (data == NULL) + return 0; + usb_conv_info = (usb_conv_info_t *)data; + if (tvb_length_remaining(tvb, offset) <= 0) return 0; @@ -121,8 +126,6 @@ dissect_hci_usb(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void *data) col_set_str(pinfo->cinfo, COL_PROTOCOL, "HCI_USB"); - DISSECTOR_ASSERT(usb_conv_info); - p2p_dir_save = pinfo->p2p_dir; pinfo->p2p_dir = usb_conv_info->direction; |