mirror of
https://github.com/espressif/esp-nimble.git
synced 2026-06-05 21:04:49 +00:00
nimble/host: Add Number Complete Packets event validation
Validate if HCI event received from controller has proper sizes before passing it to GAP event
This commit is contained in:
@@ -372,6 +372,10 @@ ble_hs_hci_evt_num_completed_pkts(uint8_t event_code, const void *data,
|
||||
uint16_t num_pkts;
|
||||
int i;
|
||||
|
||||
if (len < sizeof(*ev)) {
|
||||
return BLE_HS_ECONTROLLER;
|
||||
}
|
||||
|
||||
if (len != sizeof(*ev) + (ev->count * sizeof(ev->completed[0]))) {
|
||||
return BLE_HS_ECONTROLLER;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user