]> git.ipfire.org Git - thirdparty/suricata.git/commitdiff
rust: nom4 requires to add complete!() when using many! combinators
authorPierre Chifflier <chifflier@wzdftpd.net>
Fri, 8 Feb 2019 13:43:45 +0000 (14:43 +0100)
committerVictor Julien <victor@inliniac.net>
Fri, 8 Feb 2019 15:21:44 +0000 (16:21 +0100)
rust/src/dhcp/parser.rs
rust/src/dns/parser.rs
rust/src/nfs/nfs4_records.rs
rust/src/smb/smb1_records.rs

index c50ffd6fc6dbf591ca4a5fce3e1bb7bb22d7ef29..677b26d7ab804709cdf8262e6870e6ad07a160c0 100644 (file)
@@ -192,7 +192,7 @@ named!(pub parse_option<DHCPOption>,
 
 /// Parse and return all the options. Upon the end of option indicator
 /// all the data will be consumed.
-named!(pub parse_all_options<Vec<DHCPOption>>, many0!(call!(parse_option)));
+named!(pub parse_all_options<Vec<DHCPOption>>, many0!(complete!(call!(parse_option))));
 
 pub fn dhcp_parse(input: &[u8]) -> IResult<&[u8], DHCPMessage> {
     match parse_header(input) {
index 15c2bb52bd2ef638dccaace4fd46cd439570cdc7..4e1d551ef3e4b1c018905b559f55b2e8d593d058 100644 (file)
@@ -179,7 +179,7 @@ fn dns_parse_answer<'a>(slice: &'a [u8], message: &'a [u8], count: usize)
                 let result: IResult<&'a [u8], Vec<Vec<u8>>> =
                     closure!(&'a [u8], do_parse!(
                         rdata: many_m_n!(1, n,
-                                         apply!(dns_parse_rdata, message, rrtype))
+                                         complete!(apply!(dns_parse_rdata, message, rrtype)))
                             >> (rdata)
                     ))(data);
                 match result {
index f758a86c4c2820b92f79924926ee6ab9b2e65999..270e7b68f2482e1aa9f59eed8789b78a6c4a6551 100644 (file)
@@ -672,7 +672,7 @@ named!(nfs4_res_readdir_ok<Nfs4ResponseReaddir>,
     do_parse!(
             _verifier: be_u64
         // run parser until we find a 'value follows == 0'
-        >>  listing: many_till!(call!(nfs4_res_readdir_entry), peek!(tag!(b"\x00\x00\x00\x00")))
+        >>  listing: many_till!(complete!(call!(nfs4_res_readdir_entry)), peek!(tag!(b"\x00\x00\x00\x00")))
         // value follows == 0 checked by line above
         >>  _value_follows: be_u32
         >>  eof: be_u32
index 084bfa0fb8457ec4e98b516ab52903d65f732468..15f45e69432285d290611838c53a11f7cf89330d 100644 (file)
@@ -160,7 +160,7 @@ named!(pub parse_smb1_negotiate_protocol_record<Smb1NegotiateProtocolRecord>,
            _wtc: le_u8
         >> _bcc: le_u16
         // dialects is a list of [1 byte buffer format][string][0 terminator]
-        >> dialects: many1!(take_until_and_consume!("\0"))
+        >> dialects: many1!(complete!(take_until_and_consume!("\0")))
         >> (Smb1NegotiateProtocolRecord {
                 dialects
             }))