mirror of
https://github.com/espressif/esp-idf.git
synced 2026-08-18 06:35:35 +03:00
fix(ble/bluedroid): Fix security issues in HCI module
This commit is contained in:
@@ -452,10 +452,12 @@ static bool filter_incoming_event(BT_HDR *packet)
|
||||
STREAM_TO_UINT8(hci_host_env.command_credits, stream);
|
||||
STREAM_TO_UINT16(opcode, stream);
|
||||
wait_entry = get_waiting_command(opcode);
|
||||
metadata = (hci_cmd_metadata_t *)(wait_entry->data);
|
||||
if (!wait_entry) {
|
||||
HCI_TRACE_WARNING("%s command complete event with no matching command. opcode: 0x%x.", __func__, opcode);
|
||||
} else if (metadata->command_complete_cb) {
|
||||
goto intercepted;
|
||||
}
|
||||
metadata = (hci_cmd_metadata_t *)(wait_entry->data);
|
||||
if (metadata->command_complete_cb) {
|
||||
metadata->command_complete_cb(packet, metadata->context);
|
||||
#if (BLE_50_FEATURE_SUPPORT == TRUE)
|
||||
BlE_SYNC *sync_info = btsnd_hcic_ble_get_sync_info();
|
||||
@@ -482,10 +484,12 @@ static bool filter_incoming_event(BT_HDR *packet)
|
||||
// If a command generates a command status event, it won't be getting a command complete event
|
||||
|
||||
wait_entry = get_waiting_command(opcode);
|
||||
metadata = (hci_cmd_metadata_t *)(wait_entry->data);
|
||||
if (!wait_entry) {
|
||||
HCI_TRACE_WARNING("%s command status event with no matching command. opcode: 0x%x", __func__, opcode);
|
||||
} else if (metadata->command_status_cb) {
|
||||
goto intercepted;
|
||||
}
|
||||
metadata = (hci_cmd_metadata_t *)(wait_entry->data);
|
||||
if (metadata->command_status_cb) {
|
||||
metadata->command_status_cb(status, &metadata->command, metadata->context);
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user