AmendHub

jcs

/

subtext

/

amendments

/

240

telnet: Increase IAC SB buffer, log when it overflows

macOS telnet clients have a very long DISPLAY variable that was
reaching our limit of iac_sb, which then spilled into the login field
since we stop treating further data as IAC SB data.

jcs made amendment 240 about 1 month ago
--- telnet.c Sun Jul 31 23:00:59 2022 +++ telnet.c Thu Aug 11 09:17:23 2022 @@ -101,7 +101,7 @@ struct telnet_node { unsigned short sending_iac; unsigned short escaped_obuflen; short iac_state; - unsigned char iac_sb[64]; + unsigned char iac_sb[128]; short sb_len; /* docs say 4*MTU+1024, but MTU will probably be <1500 */ unsigned char tcp_buf[(4 * 1500) + 1024]; @@ -629,6 +629,7 @@ telnet_input(struct session *session) /* IAC overflow */ node->iac_state = TELNET_IAC_STATE_IDLE; node->sb_len = 0; + session_log(session, "IAC SB overflow"); } } break;