diff options
author | Chris Maynard <Christopher.Maynard@GTECH.COM> | 2013-12-09 21:20:52 +0000 |
---|---|---|
committer | Chris Maynard <Christopher.Maynard@GTECH.COM> | 2013-12-09 21:20:52 +0000 |
commit | aba06b568d02eb70286c5ae01dd4e15f9c4880f6 (patch) | |
tree | fb19178b01823f2231ebc0201c5ff9182892df9a /epan/dissectors/packet-zbee-nwk.c | |
parent | b369351d2f7409b695107b53ed09fd828f919436 (diff) |
Reject the packet if data is NULL.
svn path=/trunk/; revision=53893
Diffstat (limited to 'epan/dissectors/packet-zbee-nwk.c')
-rw-r--r-- | epan/dissectors/packet-zbee-nwk.c | 14 |
1 files changed, 12 insertions, 2 deletions
diff --git a/epan/dissectors/packet-zbee-nwk.c b/epan/dissectors/packet-zbee-nwk.c index 73970cd6c3..88898114df 100644 --- a/epan/dissectors/packet-zbee-nwk.c +++ b/epan/dissectors/packet-zbee-nwk.c @@ -352,7 +352,7 @@ dissect_zbee_nwk(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void* data proto_tree *field_tree = NULL; zbee_nwk_packet packet; - ieee802154_packet *ieee_packet = (ieee802154_packet *)data; + ieee802154_packet *ieee_packet; guint offset = 0; static gchar src_addr[32], dst_addr[32]; /* has to be static due to SET_ADDRESS */ @@ -366,6 +366,11 @@ dissect_zbee_nwk(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void* data zbee_nwk_hints_t *nwk_hints; gboolean unicast_src; + /* Reject the packet if data is NULL */ + if (data == NULL) + return 0; + ieee_packet = (ieee802154_packet *)data; + memset(&packet, 0, sizeof(packet)); /* Set up hint structures */ @@ -1391,7 +1396,7 @@ dissect_zbee_nwk_update(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, gui */ static int dissect_zbee_beacon(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void* data) { - ieee802154_packet *packet = (ieee802154_packet *)data; + ieee802154_packet *packet; proto_item *beacon_root = NULL; proto_tree *beacon_tree = NULL; @@ -1402,6 +1407,11 @@ static int dissect_zbee_beacon(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tr guint64 epid; guint32 tx_offset; + /* Reject the packet if data is NULL */ + if (data == NULL) + return 0; + packet = (ieee802154_packet *)data; + /* Add ourself to the protocol column. */ col_set_str(pinfo->cinfo, COL_PROTOCOL, "ZigBee"); /* Create the tree for this beacon. */ |