From 66d55a7f35ed16601ff1875b38e5819340d57e5d Mon Sep 17 00:00:00 2001 From: Sascha Steinbiss Date: Fri, 9 Jun 2023 11:12:02 +0200 Subject: [PATCH] rfb: be more strict parsing the version (cherry picked from commit bd1fbf392e04e0bfc4b8f7e680636ddee0a47c60) --- rust/src/rfb/parser.rs | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) 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(), -- 2.47.2