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 09:44:30 +01:00
committed by Rahul Tank
parent 3ca9380195
commit 6c72124312
+4
View File
@@ -359,6 +359,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;
}