Browse Source

Issue #185. Discard MQTT messages with payload size 0

fastled
Xose Pérez 7 years ago
parent
commit
2531bc638a
1 changed files with 2 additions and 0 deletions
  1. +2
    -0
      code/espurna/mqtt.ino

+ 2
- 0
code/espurna/mqtt.ino View File

@ -211,6 +211,8 @@ void _mqttOnDisconnect() {
void _mqttOnMessage(char* topic, char* payload, unsigned int len) { void _mqttOnMessage(char* topic, char* payload, unsigned int len) {
if (len == 0) return;
char message[len + 1]; char message[len + 1];
strlcpy(message, (char *) payload, len + 1); strlcpy(message, (char *) payload, len + 1);


Loading…
Cancel
Save