Skip to content

Commit

Permalink
Corrected count of characteristics to get (#3082)
Browse files Browse the repository at this point in the history
Only space for 1 characteristic is allocated, requesting 10 leads to stack corruption.
  • Loading branch information
arjanmels authored and me-no-dev committed Aug 20, 2019
1 parent 7357667 commit a12d609
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion libraries/BLE/src/BLERemoteService.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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(),
Expand Down

0 comments on commit a12d609

Please sign in to comment.