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.
This commit is contained in:
Valentin V. Bartenev authored and GitHub committed 2026-04-28 21:49:28 +03:00
1 parent f886bb3244
commit 4d873b60f4
1 file changed
+1 -1
+1 -1
View File
@@ -94,7 +94,7 @@ private:
char* token;
char client_id[48];
char status_topic[128];
char offline_payload[256];
char offline_payload[512];
};
#endif