Merge in SNORT/snort3 from ~AMUTTUVA/snort3:telnet_cr_fix to master
Squashed commit of the following:
commit
c7c9dbff527ab392d276e6deae89b542b5ca13a4
Author: Akhilesh MY <amuttuva@cisco.com>
Date: Tue Aug 6 02:41:17 2024 -0400
telnet: avoid flush when cr or lf is between commands
ptr = lf;
else if ( cr && lf )
ptr = ( cr > lf ) ? cr : lf;
- if ( ptr )
+
+ const uint8_t* iac_ptr = static_cast<const uint8_t*>(memchr( read_ptr, TNC_IAC, end - read_ptr));
+ if ( (ptr && iac_ptr && ptr < iac_ptr) || (ptr && !iac_ptr) )
{
fp_ptr = ptr;
read_ptr = fp_ptr;
}
- const uint8_t* iac_ptr = static_cast<const uint8_t*>(memchr( read_ptr, TNC_IAC, end - read_ptr));
if ( iac_ptr )
{
state = TELNET_IAC;