From 4d873b60f497c2049e36d42253fecc824827b1ed Mon Sep 17 00:00:00 2001 From: "Valentin V. Bartenev" Date: Tue, 28 Apr 2026 21:49:28 +0300 Subject: [PATCH] fix: truncated LWT message That JSON includes eight fields: status, timestamp (26 chars), origin (up to 80 chars, escaped), origin_id (64-char hex public key), model (up to 40 chars), firmware_version, radio (up to 48 chars), and client_version (up to 96 chars). In the worst case the formatted string approaches ~490 bytes. Even in a typical scenario: JSON skeleton and status (126 chars), origin (~20 chars), origin_id (64 chars), model (~16 chars), firmware_version (~7 chars), radio (~16 chars), client_version (20 chars) the formatted string is around 269 chars, causing snprintf() to silently truncate the payload and results in malformed JSON. --- src/helpers/mqtt/MQTTUplink.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/helpers/mqtt/MQTTUplink.h b/src/helpers/mqtt/MQTTUplink.h index 619f7907..33a1ff56 100644 --- a/src/helpers/mqtt/MQTTUplink.h +++ b/src/helpers/mqtt/MQTTUplink.h @@ -94,7 +94,7 @@ private: char* token; char client_id[48]; char status_topic[128]; - char offline_payload[256]; + char offline_payload[512]; }; #endif