From 1bc5cc4860c24dd97bd3bd796ce57a5e84a2dc41 Mon Sep 17 00:00:00 2001 From: Ben Meadors Date: Thu, 24 Jul 2025 06:13:00 -0500 Subject: [PATCH] Update src/mqtt/MQTT.cpp Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com> --- src/mqtt/MQTT.cpp | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/mqtt/MQTT.cpp b/src/mqtt/MQTT.cpp index 55a003f1b..86497bf5f 100644 --- a/src/mqtt/MQTT.cpp +++ b/src/mqtt/MQTT.cpp @@ -644,7 +644,8 @@ bool MQTT::isValidConfig(const meshtastic_ModuleConfig_MQTTConfig &config, MQTTC meshtastic_ClientNotification *cn = clientNotificationPool.allocZeroed(); cn->level = meshtastic_LogRecord_Level_ERROR; cn->time = getValidTime(RTCQualityFromNet); - strcpy(cn->message, warning); + strncpy(cn->message, warning, sizeof(cn->message) - 1); + cn->message[sizeof(cn->message) - 1] = '\0'; // Ensure null termination service->sendClientNotification(cn); return false; }