From 83957fae1582e46d0490156473cde8aa77f656c4 Mon Sep 17 00:00:00 2001 From: Stephan Hadinger Date: Sun, 23 Aug 2020 15:22:36 +0200 Subject: [PATCH] Zigbee limit friendly name to 32 bytes --- tasmota/xdrv_23_zigbee_A_impl.ino | 1 + 1 file changed, 1 insertion(+) diff --git a/tasmota/xdrv_23_zigbee_A_impl.ino b/tasmota/xdrv_23_zigbee_A_impl.ino index e9a9722f4..a214a9676 100644 --- a/tasmota/xdrv_23_zigbee_A_impl.ino +++ b/tasmota/xdrv_23_zigbee_A_impl.ino @@ -978,6 +978,7 @@ void CmndZbName(void) { const char * friendlyName = zigbee_devices.getFriendlyName(shortaddr); Response_P(PSTR("{\"0x%04X\":{\"" D_JSON_ZIGBEE_NAME "\":\"%s\"}}"), shortaddr, friendlyName ? friendlyName : ""); } else { + if (strlen(p) > 32) { p[32] = 0x00; } // truncate to 32 chars max zigbee_devices.setFriendlyName(shortaddr, p); Response_P(PSTR("{\"0x%04X\":{\"" D_JSON_ZIGBEE_NAME "\":\"%s\"}}"), shortaddr, p); }