From a12d609b221ce339de092cfe096c6bef7542c943 Mon Sep 17 00:00:00 2001 From: Arjan Mels <43108771+arjanmels@users.noreply.github.com> Date: Tue, 20 Aug 2019 15:38:59 +0200 Subject: [PATCH] Corrected count of characteristics to get (#3082) Only space for 1 characteristic is allocated, requesting 10 leads to stack corruption. --- libraries/BLE/src/BLERemoteService.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/libraries/BLE/src/BLERemoteService.cpp b/libraries/BLE/src/BLERemoteService.cpp index 5c65f955..35d7c727 100644 --- a/libraries/BLE/src/BLERemoteService.cpp +++ b/libraries/BLE/src/BLERemoteService.cpp @@ -164,7 +164,7 @@ void BLERemoteService::retrieveCharacteristics() { uint16_t offset = 0; esp_gattc_char_elem_t result; while (true) { - uint16_t count = 10; // this value is used as in parameter that allows to search max 10 chars with the same uuid + uint16_t count = 1; // only room for 1 result allocated, so go one by one esp_gatt_status_t status = ::esp_ble_gattc_get_all_char( getClient()->getGattcIf(), getClient()->getConnId(),