Merge pull request #2539 from dylan09/multirelay-discovery
Fixed buffer overflow in HA autodiscovery. #2538
This commit is contained in:
commit
6d2ef4e0bf
@ -272,7 +272,7 @@ class MultiRelay : public Usermod {
|
|||||||
|
|
||||||
void publishHomeAssistantAutodiscovery() {
|
void publishHomeAssistantAutodiscovery() {
|
||||||
for (uint8_t i = 0; i < MULTI_RELAY_MAX_RELAYS; i++) {
|
for (uint8_t i = 0; i < MULTI_RELAY_MAX_RELAYS; i++) {
|
||||||
char uid[16], json_str[1024], buf[128];
|
char uid[24], json_str[1024], buf[128];
|
||||||
size_t payload_size;
|
size_t payload_size;
|
||||||
sprintf_P(uid, PSTR("%s_sw%d"), escapedMac.c_str(), i);
|
sprintf_P(uid, PSTR("%s_sw%d"), escapedMac.c_str(), i);
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user