Commit 4cb8d1e
committed
Fix buffer over-read in wolfSSH_DoModes terminal mode parsing
The while loop condition only checked that the opcode byte was in bounds
(idx < modesSz) but not the 4-byte argument read by ato32(). When
modesSz had a remainder of 1 mod 5 and the trailing byte was a valid
opcode (1-159) rather than TTY_OP_END, ato32() would read 4 bytes past
the buffer. Change the loop guard to require a full TERMINAL_MODE_SZ
bytes remaining before entering the loop body.1 parent 46cd6a7 commit 4cb8d1e
1 file changed
Lines changed: 1 addition & 1 deletion
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
8944 | 8944 | | |
8945 | 8945 | | |
8946 | 8946 | | |
8947 | | - | |
| 8947 | + | |
8948 | 8948 | | |
8949 | 8949 | | |
8950 | 8950 | | |
| |||
0 commit comments