You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
SInce the latest update (v2.8) publish_P(const char* topic, const char* payload, boolean retained)
crashes when using it with payload located in PROGMEM.
Example: Using of client.publish_P("outTopic_P", PSTR("test"), true);
was possible in v2.7, but no longer in v2.8. (tested with mqtt_esp8266)
Seems that the problem is in line 475 return publish_P(topic, (const uint8_t*)payload, payload ? strnlen(payload, this->bufferSize) : 0, retained);
Maybe better use strnlen_P.
Thank you.
The text was updated successfully, but these errors were encountered:
@absalom-muc Thanks for your post. I encountered the same problem and your suggested fix works for me.
I found another pull request to fix this here: https://github.com/knolleary/pubsubclient/pull/745/commits, but the build failed caused by an incorrect include of #include <avr/pgmspace.h> for ESP8266. I've added a comment to fix that, otherwise I can create a new pull request on master.
SInce the latest update (v2.8)
publish_P(const char* topic, const char* payload, boolean retained)
crashes when using it with payload located in PROGMEM.
Example: Using of
client.publish_P("outTopic_P", PSTR("test"), true);
was possible in v2.7, but no longer in v2.8. (tested with mqtt_esp8266)
Seems that the problem is in line 475
return publish_P(topic, (const uint8_t*)payload, payload ? strnlen(payload, this->bufferSize) : 0, retained);
Maybe better use strnlen_P.
Thank you.
The text was updated successfully, but these errors were encountered: