Skip to content

Commit 795b85e

Browse files
committed
wolfsshd: save shellBuffer on WS_WANT_WRITE
ChannelIdSend / extended_data_send returning WS_WANT_WRITE set wantWrite but didn't save cnt_r, so the next read overwrote the held bytes. Store cnt_r in windowFull at all three read sites (stderr, stdout, pty childFd); flag windowFullExt for stderr so the retry routes through extended_data_send.
1 parent 62b87e9 commit 795b85e

1 file changed

Lines changed: 4 additions & 0 deletions

File tree

apps/wolfsshd/wolfsshd.c

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1691,6 +1691,8 @@ static int SHELL_Subsystem(WOLFSSHD_CONNECTION* conn, WOLFSSH* ssh,
16911691
continue;
16921692
}
16931693
else if (cnt_w == WS_WANT_WRITE) {
1694+
windowFull = cnt_r;
1695+
windowFullExt = 1;
16941696
wantWrite = 1;
16951697
continue;
16961698
}
@@ -1729,6 +1731,7 @@ static int SHELL_Subsystem(WOLFSSHD_CONNECTION* conn, WOLFSSH* ssh,
17291731
continue;
17301732
}
17311733
else if (cnt_w == WS_WANT_WRITE) {
1734+
windowFull = cnt_r;
17321735
wantWrite = 1;
17331736
continue;
17341737
}
@@ -1765,6 +1768,7 @@ static int SHELL_Subsystem(WOLFSSHD_CONNECTION* conn, WOLFSSH* ssh,
17651768
continue;
17661769
}
17671770
else if (cnt_w == WS_WANT_WRITE) {
1771+
windowFull = cnt_r;
17681772
wantWrite = 1;
17691773
continue;
17701774
}

0 commit comments

Comments
 (0)