Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

nimble/host: Validate advertising instance before parsing event #1874

Merged
merged 1 commit into from
Sep 24, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 14 additions & 0 deletions nimble/host/src/ble_hs_hci_evt.c
Original file line number Diff line number Diff line change
Expand Up @@ -879,6 +879,13 @@ ble_hs_hci_evt_le_adv_set_terminated(uint8_t subevent, const void *data,
return BLE_HS_ECONTROLLER;
}

/* this indicates bug in controller as host uses instances from
* 0-BLE_ADV_INSTANCES range only
*/
if (ev->adv_handle >= BLE_ADV_INSTANCES) {
return BLE_HS_ECONTROLLER;
}

if (ev->status == 0) {
/* ignore return code as we need to terminate advertising set anyway */
ble_gap_rx_conn_complete(&pend_conn_complete, ev->adv_handle);
Expand All @@ -900,6 +907,13 @@ ble_hs_hci_evt_le_scan_req_rcvd(uint8_t subevent, const void *data,
return BLE_HS_ECONTROLLER;
}

/* this indicates bug in controller as host uses instances from
* 0-BLE_ADV_INSTANCES range only
*/
if (ev->adv_handle >= BLE_ADV_INSTANCES) {
return BLE_HS_ECONTROLLER;
}

ble_gap_rx_scan_req_rcvd(ev);
#endif

Expand Down
Loading