diff options
-rw-r--r-- | epan/dissectors/packet-btavrcp.c | 8 | ||||
-rw-r--r-- | epan/dissectors/packet-bthci_acl.c | 8 | ||||
-rw-r--r-- | epan/dissectors/packet-bthci_evt.c | 8 |
3 files changed, 15 insertions, 9 deletions
diff --git a/epan/dissectors/packet-btavrcp.c b/epan/dissectors/packet-btavrcp.c index 4a3c8ffad6..2bcbad264f 100644 --- a/epan/dissectors/packet-btavrcp.c +++ b/epan/dissectors/packet-btavrcp.c @@ -2095,6 +2095,11 @@ dissect_btavrcp(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void *data) guint32 psm; btavctp_data_t *avctp_data; + /* Reject the packet if data is NULL */ + if (data == NULL) + return 0; + avctp_data = (btavctp_data_t *) data; + ti = proto_tree_add_item(tree, proto_btavrcp, tvb, offset, -1, ENC_NA); btavrcp_tree = proto_item_add_subtree(ti, ett_btavrcp); @@ -2113,9 +2118,6 @@ dissect_btavrcp(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void *data) break; } - avctp_data = (btavctp_data_t *) data; - DISSECTOR_ASSERT(avctp_data); - is_command = !avctp_data->cr; interface_id = avctp_data->interface_id; diff --git a/epan/dissectors/packet-bthci_acl.c b/epan/dissectors/packet-bthci_acl.c index c48ea26ee2..6970cbe9c0 100644 --- a/epan/dissectors/packet-bthci_acl.c +++ b/epan/dissectors/packet-bthci_acl.c @@ -118,6 +118,11 @@ dissect_bthci_acl(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void *dat localhost_bdaddr_entry_t *localhost_bdaddr_entry; localhost_name_entry_t *localhost_name_entry; + /* Reject the packet if data is NULL */ + if (data == NULL) + return 0; + hci_data = (hci_data_t *) data; + ti = proto_tree_add_item(tree, proto_bthci_acl, tvb, offset, -1, ENC_NA); bthci_acl_tree = proto_item_add_subtree(ti, ett_bthci_acl); @@ -136,9 +141,6 @@ dissect_bthci_acl(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void *dat col_set_str(pinfo->cinfo, COL_PROTOCOL, "HCI_ACL"); - hci_data = (hci_data_t *) data; - DISSECTOR_ASSERT(hci_data); - flags = tvb_get_letohs(tvb, offset); pb_flag = (flags & 0x3000) >> 12; proto_tree_add_item(bthci_acl_tree, hf_bthci_acl_chandle, tvb, offset, 2, ENC_LITTLE_ENDIAN); diff --git a/epan/dissectors/packet-bthci_evt.c b/epan/dissectors/packet-bthci_evt.c index f79b8701cd..55ad423969 100644 --- a/epan/dissectors/packet-bthci_evt.c +++ b/epan/dissectors/packet-bthci_evt.c @@ -3647,6 +3647,11 @@ dissect_bthci_evt(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void *dat gint offset = 0; hci_data_t *hci_data; + /* Reject the packet if data is NULL */ + if (data == NULL) + return 0; + hci_data = (hci_data_t *) data; + ti = proto_tree_add_item(tree, proto_bthci_evt, tvb, offset, -1, ENC_NA); bthci_evt_tree = proto_item_add_subtree(ti, ett_bthci_evt); @@ -3666,9 +3671,6 @@ dissect_bthci_evt(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void *dat SET_ADDRESS(&pinfo->src, AT_STRINGZ, 11, "controller"); SET_ADDRESS(&pinfo->dst, AT_STRINGZ, 5, "host"); - hci_data = (hci_data_t *) data; - DISSECTOR_ASSERT(hci_data); - evt_code = tvb_get_guint8(tvb, offset); proto_tree_add_item(bthci_evt_tree, hf_bthci_evt_code, tvb, offset, 1, ENC_LITTLE_ENDIAN); proto_item_append_text(bthci_evt_tree, " - %s", val_to_str_ext_const(evt_code, &evt_code_vals_ext, "Unknown 0x%08x")); |