mirror of
https://github.com/zhaojh329/rtty.git
synced 2026-02-27 09:53:17 +08:00
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:
@@ -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);
|
||||
|
||||
Reference in New Issue
Block a user