From 2531bc638a03db64ec154c52c1210627b227a06d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Xose=20P=C3=A9rez?= Date: Wed, 16 Aug 2017 00:09:08 +0200 Subject: [PATCH] Issue #185. Discard MQTT messages with payload size 0 --- code/espurna/mqtt.ino | 2 ++ 1 file changed, 2 insertions(+) diff --git a/code/espurna/mqtt.ino b/code/espurna/mqtt.ino index 21c6c9f1..151fcd64 100644 --- a/code/espurna/mqtt.ino +++ b/code/espurna/mqtt.ino @@ -211,6 +211,8 @@ void _mqttOnDisconnect() { void _mqttOnMessage(char* topic, char* payload, unsigned int len) { + if (len == 0) return; + char message[len + 1]; strlcpy(message, (char *) payload, len + 1);