Repeater, room server, sensor: a long unknown get no longer overruns the reply buffer
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
1 parent
961547c7d2
commit
dcf10d1c86
1 file changed
+5
-1
@@ -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);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in new issue
Block a user