Fixed an error with array out of bounds

This commit is contained in:
2024-06-09 11:19:18 +03:00
parent 925df4b27c
commit 3fb2e82a8e

View File

@ -1039,7 +1039,7 @@ void zh_espnow_switch_send_mqtt_json_config_message(const zh_espnow_data_t *devi
memset(qos, 0, 4); memset(qos, 0, 4);
sprintf(qos, "%d", device_data->payload_data.config_message.switch_config_message.qos); sprintf(qos, "%d", device_data->payload_data.config_message.switch_config_message.qos);
zh_json_t json = {0}; zh_json_t json = {0};
char buffer[512] = {0}; char buffer[1024] = {0};
zh_json_init(&json); zh_json_init(&json);
zh_json_add(&json, "platform", "mqtt"); zh_json_add(&json, "platform", "mqtt");
zh_json_add(&json, "name", name); zh_json_add(&json, "name", name);