]> git.ipfire.org Git - thirdparty/suricata.git/commitdiff
rfb: be more strict parsing the version
authorSascha Steinbiss <satta@debian.org>
Fri, 9 Jun 2023 09:12:02 +0000 (11:12 +0200)
committerSascha Steinbiss <satta@debian.org>
Fri, 14 Jul 2023 08:47:00 +0000 (10:47 +0200)
(cherry picked from commit bd1fbf392e04e0bfc4b8f7e680636ddee0a47c60)

rust/src/rfb/parser.rs

index 8aed9c7f817c9813ae79fdbb970bc9ba69b7f04e..9ec311eb3b4f6041c04b9d21320fbd38985da1f3 100644 (file)
@@ -112,12 +112,11 @@ pub struct ServerInit {
 
 named!(pub parse_protocol_version<ProtocolVersion>,
     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(),