jcs
/subtext
/amendments
/493
telnet: When escaping IACs, leave room in case one is the final byte
jcs made amendment 493 about 1 year ago
--- telnet.c Thu Apr 27 00:31:32 2023
+++ telnet.c Thu Apr 27 08:01:55 2023
@@ -776,7 +776,7 @@ process_result:
/* copy obuf to node buffer, escaping IACs */
for (node->escaped_obuflen = 0, node->obuflen = 0;
node->obuflen < session->obuflen &&
- node->escaped_obuflen < sizeof(node->obuf);
+ node->escaped_obuflen < sizeof(node->obuf) - 1;
node->obuflen++) {
c = session->obuf[node->obuflen];