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
This commit is contained in:
Mike Kolcun 2021-04-02 14:04:27 -04:00 committed by GitHub
parent d603a8a9be
commit a69dcfc49d
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -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