aboutsummaryrefslogtreecommitdiffstats
path: root/epan/dissectors/packet-bthci_evt.c
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/dissectors/packet-bthci_evt.c
parent99d9c3d0f5d9541cbad0a8904e3bd113b8010c28 (diff)
eject the packet if data is NULL without doing anything else.
svn path=/trunk/; revision=53733
Diffstat (limited to 'epan/dissectors/packet-bthci_evt.c')
-rw-r--r--epan/dissectors/packet-bthci_evt.c8
1 files changed, 5 insertions, 3 deletions
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"));