Bluetooth: HCI_EVT: Fix empty advertising data

LE Advertising Report with length 0 is valid, so check
it before dissecting adverising data.

Change-Id: I4937ec2de5d703b05c6e5f5bac7f81d153e49b40
Reviewed-on: https://code.wireshark.org/review/475
Reviewed-by: Anders Broman <a.broman58@gmail.com>
This commit is contained in:
Michal Labedzki 2014-03-03 08:51:27 +01:00 committed by Anders Broman
parent aac1e0a06a
commit fc2be9eac4
1 changed files with 5 additions and 3 deletions

View File

@ -1782,9 +1782,11 @@ dissect_bthci_evt_le_meta(tvbuff_t *tvb, int offset, packet_info *pinfo,
proto_tree_add_item(tree, hf_bthci_evt_data_length, tvb, offset, 1, ENC_NA);
offset += 1;
call_dissector(btcommon_ad_handle, tvb_new_subset(tvb, offset, length, length), pinfo, tree);
save_remote_device_name(tvb, offset, pinfo, length, bd_addr, hci_data);
offset += length;
if (length > 0) {
call_dissector(btcommon_ad_handle, tvb_new_subset(tvb, offset, length, length), pinfo, tree);
save_remote_device_name(tvb, offset, pinfo, length, bd_addr, hci_data);
offset += length;
}
proto_tree_add_item(tree, hf_bthci_evt_rssi, tvb, offset, 1, ENC_LITTLE_ENDIAN);
offset += 1;