From dcf10d1c86c4b1a423f18d56c4809fd5ea6cbc5d Mon Sep 17 00:00:00 2001 From: TeTeHacko Date: Thu, 19 Nov 2026 15:56:28 +0100 Subject: [PATCH] Repeater, room server, sensor: a long unknown `get` no longer overruns the reply buffer Co-Authored-By: Claude Opus 5.5 --- src/helpers/CommonCLI.cpp | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/src/helpers/CommonCLI.cpp b/src/helpers/CommonCLI.cpp index f341924f..0fc110a0 100644 --- a/src/helpers/CommonCLI.cpp +++ b/src/helpers/CommonCLI.cpp @@ -1102,7 +1102,11 @@ void CommonCLI::handleGetCmd(uint32_t sender_timestamp, char* command, char* rep sprintf(reply, "No extra SF configured"); } } else { - sprintf(reply, "??: %s", config); + // CUSTOM (TeTeHacko): bounded echo, as the `set` branch does. An unbounded + // sprintf put a remote `get <167 chars>` (172 B reply) into the 164 B the + // repeater and room server leave for it (temp[169] minus the 5 B header). + strcpy(reply, "??: "); + StrHelper::strncpy(&reply[4], config, 160-5); } }