aboutsummaryrefslogtreecommitdiffstats
path: root/epan
diff options
context:
space:
mode:
authorChris Maynard <Christopher.Maynard@GTECH.COM>2013-12-02 21:13:29 +0000
committerChris Maynard <Christopher.Maynard@GTECH.COM>2013-12-02 21:13:29 +0000
commitb5e37755356964c44c66b057fce871a43ad8afd1 (patch)
treefaba90e656e5be43e1bba9bfd94418848ffbea9e /epan
parent99d9c3d0f5d9541cbad0a8904e3bd113b8010c28 (diff)
eject the packet if data is NULL without doing anything else.
svn path=/trunk/; revision=53733
Diffstat (limited to 'epan')
-rw-r--r--epan/dissectors/packet-btavrcp.c8
-rw-r--r--epan/dissectors/packet-bthci_acl.c8
-rw-r--r--epan/dissectors/packet-bthci_evt.c8
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"));