1
0
mirror of https://github.com/open-simh/simh.git synced 2026-01-13 15:27:46 +00:00

TMXR: Fix potential SegFault while negotiating telnet options

If a telnet session sends options just prior to closing a session, the response
traffic might get dropped which isn't a problem, but we need to make sure
that we stop referencing the now invalid line structure after that happens.
This commit is contained in:
Mark Pizzolato 2017-12-22 03:20:32 -08:00
parent ddb0ee2895
commit 305ce5b598

View File

@ -1979,7 +1979,8 @@ for (i = 0; i < mp->lines; i++) { /* loop thru lines */
lp->notelnet = FALSE;
tmxr_putc_ln (lp, TN_WONT);
tmxr_putc_ln (lp, tmp);
lp->telnet_sent_opts[tmp] |= TNOS_WONT;/* Record WONT sent */
if (lp->conn) /* Still connected ? */
lp->telnet_sent_opts[tmp] |= TNOS_WONT;/* Record WONT sent */
}
}
case TNS_SKIP: default: /* skip char */