nimble/transport: Skip H4 event parsing if received event is too big

If received HCI event is too big to handle just return error and
stop parsing instead of overwriting data in memeory.
This commit is contained in:
Szymon Janc
2025-06-30 15:31:04 +02:00
committed by Rahul Tank
parent e52e061c49
commit d8106042fa
@@ -164,6 +164,9 @@ hci_h4_sm_w4_header(struct hci_h4_sm *h4sm, struct hci_h4_input_buffer *ib)
}
h4sm->exp_len = h4sm->hdr[1] + 2;
if (h4sm->exp_len > MYNEWT_VAL(BLE_TRANSPORT_EVT_SIZE)) {
return -1;
}
break;
case HCI_H4_ISO:
assert(h4sm->allocs && h4sm->allocs->iso);