From a69dcfc49d104e6dc899179a121a2170e27be5ed Mon Sep 17 00:00:00 2001 From: Mike Kolcun Date: Fri, 2 Apr 2021 14:04:27 -0400 Subject: [PATCH] Increase buffer size Avoid buffer overflows with longer mqtt topics mqtDeviceTopic in wled.h is defined with a size of 33, so this should be set to 45 to accommodate the additional 12 characters - /temperature --- usermods/Temperature/usermod_temperature.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/usermods/Temperature/usermod_temperature.h b/usermods/Temperature/usermod_temperature.h index 1ce0322e..9019fd17 100644 --- a/usermods/Temperature/usermod_temperature.h +++ b/usermods/Temperature/usermod_temperature.h @@ -120,7 +120,7 @@ class UsermodTemperature : public Usermod { getTemperature(); if (WLED_MQTT_CONNECTED) { - char subuf[38]; + char subuf[45]; strcpy(subuf, mqttDeviceTopic); if (-100 <= temperature) { // dont publish super low temperature as the graph will get messed up