From: Sascha Steinbiss Date: Fri, 9 Jun 2023 09:12:02 +0000 (+0200) Subject: rfb: be more strict parsing the version X-Git-Tag: suricata-6.0.14~64 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=66d55a7f35ed16601ff1875b38e5819340d57e5d;p=thirdparty%2Fsuricata.git rfb: be more strict parsing the version (cherry picked from commit bd1fbf392e04e0bfc4b8f7e680636ddee0a47c60) --- diff --git a/rust/src/rfb/parser.rs b/rust/src/rfb/parser.rs index 8aed9c7f81..9ec311eb3b 100644 --- a/rust/src/rfb/parser.rs +++ b/rust/src/rfb/parser.rs @@ -112,12 +112,11 @@ pub struct ServerInit { named!(pub parse_protocol_version, do_parse!( - _rfb_string: take_str!(3) - >> be_u8 + _rfb_string: tag!("RFB ") >> major: take_str!(3) - >> be_u8 + >> _sep1: tag!(".") >> minor: take_str!(3) - >> be_u8 + >> _sep2: tag!("\n") >> ( ProtocolVersion{ major: major.to_string(),