File tree Expand file tree Collapse file tree 1 file changed +6
-1
lines changed
connectivity/FEATURE_BLE/libraries/cordio_stack/ble-host/sources/hci/dual_chip Expand file tree Collapse file tree 1 file changed +6
-1
lines changed Original file line number Diff line number Diff line change @@ -2482,6 +2482,11 @@ void hciEvtProcessCmdCmpl(uint8_t *p, uint8_t len)
24822482 uint8_t cbackEvt = 0 ;
24832483 hciEvtCback_t cback = hciCb .evtCback ;
24842484
2485+ if (len < 3 )
2486+ {
2487+ return ;
2488+ }
2489+
24852490 BSTREAM_TO_UINT8 (numPkts , p );
24862491 BSTREAM_TO_UINT16 (opcode , p );
24872492
@@ -2695,7 +2700,7 @@ void hciEvtProcessCmdCmpl(uint8_t *p, uint8_t len)
26952700 if (cbackEvt == HCI_UNHANDLED_CMD_CMPL_CBACK_EVT ) {
26962701 const uint8_t structSize = sizeof (hciUnhandledCmdCmplEvt_t ) - 1 /* removing the fake 1-byte array */ ;
26972702 const uint8_t remainingLen = len - 3 /* we already read opcode and numPkts */ ;
2698- const uint8_t msgSize = structSize + remainingLen ;
2703+ const uint16_t msgSize = structSize + remainingLen ;
26992704
27002705 pMsg = WsfBufAlloc (msgSize );
27012706 if (pMsg != NULL ) {
You can’t perform that action at this time.
0 commit comments