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:
Szymon Janc
2024-11-07 11:51:24 +01:00
parent c41feda76b
commit 4e3ac5b6e7
+4
View File
@@ -292,6 +292,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;
}