From b5e37755356964c44c66b057fce871a43ad8afd1 Mon Sep 17 00:00:00 2001 From: Chris Maynard Date: Mon, 2 Dec 2013 21:13:29 +0000 Subject: eject the packet if data is NULL without doing anything else. svn path=/trunk/; revision=53733 --- epan/dissectors/packet-bthci_evt.c | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) (limited to 'epan/dissectors/packet-bthci_evt.c') 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")); -- cgit v1.2.3