Skip to content

Commit f1ed8c8

Browse files
author
Daniel Campora
committed
cc3200: Improve telnet_parse_input() in case of an incomplete option.
1 parent 0458833 commit f1ed8c8

1 file changed

Lines changed: 3 additions & 2 deletions

File tree

cc3200/telnet/telnet.c

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -468,8 +468,9 @@ static void telnet_parse_input (uint8_t *str, int16_t *len) {
468468
}
469469
}
470470
else {
471-
_str += 3;
472-
*len -= 3;
471+
// in case we have received an incomplete telnet option, unlikely, but possible
472+
_str += MIN(3, *len);
473+
*len -= MIN(3, *len);
473474
}
474475
}
475476
}

0 commit comments

Comments
 (0)