Merge pull request #2539 from dylan09/multirelay-discovery

Fixed buffer overflow in HA autodiscovery. #2538
This commit is contained in:
Blaž Kristan 2022-02-10 00:33:16 +01:00 committed by GitHub
commit 6d2ef4e0bf
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -272,7 +272,7 @@ class MultiRelay : public Usermod {
void publishHomeAssistantAutodiscovery() {
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;
sprintf_P(uid, PSTR("%s_sw%d"), escapedMac.c_str(), i);