cotestatnt / AsyncTelegram2

Powerful, flexible and secure Arduino Telegram BOT library. Hardware independent, it can be used with any MCU capable of handling an SSL connection.
MIT License
85 stars 25 forks source link

Very serious BUG #65

Closed zkasa closed 2 years ago

zkasa commented 2 years ago

Wherever DynamicJsonDocument is used, there is this bug! A local instance of this object is created inside the method. Pointers to strings (char*) from the fields of this object are assigned to the fields of the 'message' variable and the method returns control to the outside. However, the local instance of the 'updateDoc' is destroyed when exiting the method and ALL pointers to strings become invalid!

cotestatnt commented 2 years ago

Hi @zkasa Yes you are right and this bug was already reported.

For this reason the use of char * and const char * for strings has been abandoned in favor of String variables which will be available starting from next release