diff options
author | ru <ru@FreeBSD.org> | 2001-07-20 15:14:03 +0000 |
---|---|---|
committer | ru <ru@FreeBSD.org> | 2001-07-20 15:14:03 +0000 |
commit | 016c5292379f317dda9306409b84e1959adbf0b2 (patch) | |
tree | 33cdb8b762af5868161f71fe637a4908b59418de /libexec/telnetd/termstat.c | |
parent | df6d0e0f5f58f88cf111dc596936f7e38b21b2c4 (diff) | |
download | FreeBSD-src-016c5292379f317dda9306409b84e1959adbf0b2.zip FreeBSD-src-016c5292379f317dda9306409b84e1959adbf0b2.tar.gz |
MFCrypto: fixed the remote buffer overflow.
Diffstat (limited to 'libexec/telnetd/termstat.c')
-rw-r--r-- | libexec/telnetd/termstat.c | 18 |
1 files changed, 6 insertions, 12 deletions
diff --git a/libexec/telnetd/termstat.c b/libexec/telnetd/termstat.c index c3a9609..83116c7 100644 --- a/libexec/telnetd/termstat.c +++ b/libexec/telnetd/termstat.c @@ -279,10 +279,9 @@ localstat() # endif /* KLUDGELINEMODE */ send_do(TELOPT_LINEMODE, 1); /* send along edit modes */ - (void) sprintf(nfrontp, "%c%c%c%c%c%c%c", IAC, SB, + output_data("%c%c%c%c%c%c%c", IAC, SB, TELOPT_LINEMODE, LM_MODE, useeditmode, IAC, SE); - nfrontp += 7; editmode = useeditmode; # ifdef KLUDGELINEMODE } @@ -308,10 +307,9 @@ localstat() /* * Send along appropriate edit mode mask. */ - (void) sprintf(nfrontp, "%c%c%c%c%c%c%c", IAC, SB, + output_data("%c%c%c%c%c%c%c", IAC, SB, TELOPT_LINEMODE, LM_MODE, useeditmode, IAC, SE); - nfrontp += 7; editmode = useeditmode; } @@ -355,20 +353,18 @@ flowstat() if (his_state_is_will(TELOPT_LFLOW)) { if (tty_flowmode() != flowmode) { flowmode = tty_flowmode(); - (void) sprintf(nfrontp, "%c%c%c%c%c%c", + output_data("%c%c%c%c%c%c", IAC, SB, TELOPT_LFLOW, flowmode ? LFLOW_ON : LFLOW_OFF, IAC, SE); - nfrontp += 6; } if (tty_restartany() != restartany) { restartany = tty_restartany(); - (void) sprintf(nfrontp, "%c%c%c%c%c%c", + output_data("%c%c%c%c%c%c", IAC, SB, TELOPT_LFLOW, restartany ? LFLOW_RESTART_ANY : LFLOW_RESTART_XON, IAC, SE); - nfrontp += 6; } } } @@ -441,10 +437,9 @@ clientstat(code, parm1, parm2) useeditmode |= MODE_SOFT_TAB; if (tty_islitecho()) useeditmode |= MODE_LIT_ECHO; - (void) sprintf(nfrontp, "%c%c%c%c%c%c%c", IAC, + output_data("%c%c%c%c%c%c%c", IAC, SB, TELOPT_LINEMODE, LM_MODE, useeditmode, IAC, SE); - nfrontp += 7; editmode = useeditmode; } @@ -500,11 +495,10 @@ clientstat(code, parm1, parm2) set_termbuf(); if (!ack) { - (void) sprintf(nfrontp, "%c%c%c%c%c%c%c", IAC, + output_data("%c%c%c%c%c%c%c", IAC, SB, TELOPT_LINEMODE, LM_MODE, useeditmode|MODE_ACK, IAC, SE); - nfrontp += 7; } editmode = useeditmode; |