Skip to content

Commit 6af538d

Browse files
yosuke-wolfsslejohnstown
authored andcommitted
Fix
1 parent 3f981d1 commit 6af538d

1 file changed

Lines changed: 2 additions & 2 deletions

File tree

apps/wolfsshd/wolfsshd.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1019,8 +1019,8 @@ static int SHELL_Subsystem(WOLFSSHD_CONNECTION* conn, WOLFSSH* ssh,
10191019
* avoid over-reading the stack buffer. */
10201020
cmdWSizeSz = WSNPRINTF(cmdWSize, sizeof(cmdWSize), "\x1b[8;%u;%ut",
10211021
ssh->heightRows, ssh->widthChar);
1022-
if (cmdWSizeSz < 0 || cmdWSizeSz > (int)sizeof(cmdWSize)) {
1023-
cmdWSizeSz = (int)sizeof(cmdWSize);
1022+
if (cmdWSizeSz < 0 || cmdWSizeSz >= (int)sizeof(cmdWSize)) {
1023+
cmdWSizeSz = (int)sizeof(cmdWSize) - 1;
10241024
}
10251025
if (WriteFile(ptyIn, cmdWSize, cmdWSizeSz, &wrtn, 0) != TRUE) {
10261026
WLOG(WS_LOG_ERROR, "Issue with pseudo console resize");

0 commit comments

Comments
 (0)