aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDenys Vlasenko <vda.linux@googlemail.com>2016-10-13 16:17:06 +0200
committerDenys Vlasenko <vda.linux@googlemail.com>2016-10-13 16:17:06 +0200
commit662634b82902afa84a8c978c259fa0bbd7bc8c09 (patch)
tree343ff57c6d96449370c7f81cecee8675668e7dcd
parent85100a7067a51c5e6720c0a738317cc2144ab219 (diff)
downloadbusybox-w32-662634b82902afa84a8c978c259fa0bbd7bc8c09.tar.gz
busybox-w32-662634b82902afa84a8c978c259fa0bbd7bc8c09.tar.bz2
busybox-w32-662634b82902afa84a8c978c259fa0bbd7bc8c09.zip
telnetd: ifdef out a buggy error handling code path
Here, not handling the error is would just eat one input 0xff char. Correct handling would need even more corner case handling, as-is buggy handling corrupts the buffer. Since we just been told by kernel that pty is ready, EAGAIN should not be happening here anyway. function old new delta telnetd_main 1798 1785 -13 Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
-rw-r--r--networking/telnetd.c8
1 files changed, 8 insertions, 0 deletions
diff --git a/networking/telnetd.c b/networking/telnetd.c
index 1de3abcc7..303ef1be7 100644
--- a/networking/telnetd.c
+++ b/networking/telnetd.c
@@ -192,8 +192,16 @@ safe_write_to_pty_decode_iac(struct tsession *ts)
192 /* Literal 255 (emacs M-DEL) */ 192 /* Literal 255 (emacs M-DEL) */
193 //bb_error_msg("255!"); 193 //bb_error_msg("255!");
194 rc = safe_write(ts->ptyfd, &buf[1], 1); 194 rc = safe_write(ts->ptyfd, &buf[1], 1);
195 /*
196 * If we went through buffered_IAC_for_pty==1 path,
197 * bailing out on error like below messes up the buffer.
198 * EAGAIN is highly unlikely here, other errors will be
199 * repeated on next write, let's just skip error check.
200 */
201#if 0
195 if (rc <= 0) 202 if (rc <= 0)
196 return rc; 203 return rc;
204#endif
197 rc = 2; 205 rc = 2;
198 goto update_and_return; 206 goto update_and_return;
199 } 207 }