diff options
author | Robert Cragie <Robert.Cragie@arm.com> | 2017-03-14 16:56:47 +0000 |
---|---|---|
committer | Michael Mann <mmann78@netscape.net> | 2017-03-14 23:40:32 +0000 |
commit | d448d77ac7a369e085eef6713282a4df376b4646 (patch) | |
tree | f7f30dbef8da7ba181d075d8c30b528bff7268c0 /epan/dissectors/packet-zbee-nwk.c | |
parent | 5f4f62bde027b131dcfe1b3914e4bf9d4a3f6987 (diff) |
ZigBee NWK: Add zero length beacon checks to avoid assert.
Add a zero length check on beacon to avoid assert when beacon payload is
non existent.
Change-Id: I016a97bda1590b8edc68db4f47e5c814e4eb8e0a
Reviewed-on: https://code.wireshark.org/review/20550
Petri-Dish: Michael Mann <mmann78@netscape.net>
Reviewed-by: Alexis La Goutte <alexis.lagoutte@gmail.com>
Tested-by: Petri Dish Buildbot <buildbot-no-reply@wireshark.org>
Reviewed-by: Michael Mann <mmann78@netscape.net>
Diffstat (limited to 'epan/dissectors/packet-zbee-nwk.c')
-rw-r--r-- | epan/dissectors/packet-zbee-nwk.c | 2 |
1 files changed, 2 insertions, 0 deletions
diff --git a/epan/dissectors/packet-zbee-nwk.c b/epan/dissectors/packet-zbee-nwk.c index 667eafb716..a986bfee36 100644 --- a/epan/dissectors/packet-zbee-nwk.c +++ b/epan/dissectors/packet-zbee-nwk.c @@ -1447,6 +1447,7 @@ dissect_zbee_beacon_heur(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, vo /* All ZigBee frames must always have a 16-bit source address. */ if (!packet) return FALSE; if (packet->src_addr_mode != IEEE802154_FCF_ADDR_SHORT) return FALSE; + if (tvb_captured_length(tvb) == 0) return FALSE; /* ZigBee beacons begin with a protocol identifier. */ if (tvb_get_guint8(tvb, 0) != ZBEE_NWK_BEACON_PROTOCOL_ID) return FALSE; @@ -1550,6 +1551,7 @@ dissect_zbip_beacon_heur(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, vo /* All ZigBee frames must always have a 16-bit source address. */ if (!packet) return FALSE; if (packet->src_addr_mode != IEEE802154_FCF_ADDR_SHORT) return FALSE; + if (tvb_captured_length(tvb) == 0) return FALSE; /* ZigBee beacons begin with a protocol identifier. */ if (tvb_get_guint8(tvb, 0) != ZBEE_IP_BEACON_PROTOCOL_ID) return FALSE; |