From 0affb73747226a0ab4487252d3674a8feda089b1 Mon Sep 17 00:00:00 2001 From: Paul Szczeanek Date: Tue, 2 Jun 2020 15:11:10 +0100 Subject: [PATCH] Fix bounds check using a define instead of table size. The bounds check was incorrectly picking a define that wasn't even the last in the table. It now uses the size of the table. --- .../TARGET_CORDIO/stack/ble-host/sources/stack/dm/dm_main.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/features/FEATURE_BLE/targets/TARGET_CORDIO/stack/ble-host/sources/stack/dm/dm_main.c b/features/FEATURE_BLE/targets/TARGET_CORDIO/stack/ble-host/sources/stack/dm/dm_main.c index 12047f1d0f..322ff58b49 100644 --- a/features/FEATURE_BLE/targets/TARGET_CORDIO/stack/ble-host/sources/stack/dm/dm_main.c +++ b/features/FEATURE_BLE/targets/TARGET_CORDIO/stack/ble-host/sources/stack/dm/dm_main.c @@ -230,7 +230,7 @@ dmCb_t dmCb; /*************************************************************************************************/ static void dmHciEvtCback(hciEvt_t *pEvent) { - WSF_ASSERT(pEvent->hdr.event <= HCI_LE_READ_ANTENNA_INFO_CMD_CMPL_CBACK_EVT); + WSF_ASSERT(pEvent->hdr.event < sizeof(dmHciToIdTbl)); /* if DM not resetting or resetting but incoming event is HCI reset sequence complete event */ if (!dmCb.resetting || (pEvent->hdr.event == HCI_RESET_SEQ_CMPL_CBACK_EVT))