jcs
/subtext
/amendments
/636
telnet: Enforce minimum columns/lines in NAWS handling
jcs made amendment 636 13 days ago
--- telnet.c Wed Feb 28 15:07:12 2024
+++ telnet.c Fri Sep 18 22:24:47 2026
@@ -586,6 +586,12 @@ telnet_input(struct session *session)
if (node->iac_sb[sboff] == 255)
sboff++;
session->terminal_lines |= node->iac_sb[sboff++];
+
+ if (session->terminal_columns < MIN_TERMINAL_COLUMNS)
+ session->terminal_columns = MIN_TERMINAL_COLUMNS;
+ if (session->terminal_lines < MIN_TERMINAL_LINES)
+ session->terminal_lines = MIN_TERMINAL_LINES;
+
if (node->naws_count++ < 20)
session_logf_buffered(session, "IAC NAWS %d, %d",
session->terminal_columns,