The remote cmd response must not exceed 65536 bytes.

If it exceeds 65536 bytes, it will cause a communication error.

Signed-off-by: Jianhui Zhao <zhaojh329@gmail.com>
This commit is contained in:
Jianhui Zhao
2025-08-09 22:32:25 +08:00
parent 74109c7b0b
commit e3e85e007d
+3
View File
@@ -148,6 +148,9 @@ static void cmd_reply(struct task *t, int code)
len = ceil(len * 4.0 / 3) + 200;
if (len > 0xffff)
return cmd_err_reply(rtty, t->token, RTTY_CMD_ERR_RESP_TOOBIG);
str = calloc(1, len);
if (!str) {
cmd_err_reply(t->rtty, t->token, RTTY_CMD_ERR_NOMEM);