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 6f528ad2df
commit b06bb59435
@@ -162,6 +162,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;
default:
assert(0);