Skip to content

esp8266 crashes when using payload in PROGMEM (v2.8) #747

@absalom-muc

Description

@absalom-muc

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.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions