diff --git a/sonoff/sonoff.ino b/sonoff/sonoff.ino index 161c26ed8..2a65f8f65 100755 --- a/sonoff/sonoff.ino +++ b/sonoff/sonoff.ino @@ -431,6 +431,8 @@ uint16_t GetPulseTimer(uint8_t index) void MqttDataHandler(char* topic, uint8_t* data, unsigned int data_len) { + if (data_len > MQTT_MAX_PACKET_SIZE) { return; } // Do not allow more data than would be feasable within stack space + char *str; if (!strcmp(Settings.mqtt_prefix[0],Settings.mqtt_prefix[1])) {