h2zero / esp-nimble-cpp

C++ library for the esp32 NimBLE stack based on and mostly compatible with @nkolban cpp_utils BLE library.
https://h2zero.github.io/esp-nimble-cpp/
Apache License 2.0
182 stars 62 forks source link

Initialize ble_gatt_chr_def[]. Fixes #148 #150

Closed holdersn closed 7 months ago

holdersn commented 8 months ago

IDF 5.2 introduced a new member, cpfd, to the ble_gatt_chr_def struct. It needs to be initialized to nullptr in order to avoid accessing uninitialized memory. By initializing the whole struct, we get everything initialized in a backward-compatible way.

holdersn commented 8 months ago

I've tested this change with both, IDF 5.2.1 and IDF 4.4.5

h2zero commented 7 months ago

Thanks!

Staars commented 7 months ago

This fixes a crash for me too.

Pagliacii commented 7 months ago

Any progress?