]> git.ipfire.org Git - thirdparty/suricata.git/commitdiff
rust/rdp: Fix use of incorrect buffer 5276/head
authorJeff Lucovsky <jeff@lucovsky.org>
Wed, 5 Aug 2020 13:56:58 +0000 (09:56 -0400)
committerVictor Julien <victor@inliniac.net>
Wed, 5 Aug 2020 15:30:43 +0000 (17:30 +0200)
This commit updates the connection confirmation parsing function to use
the correct buffer when determining the packet type.

rust/src/rdp/parser.rs

index 847e3bbbb5da7f6f387084f117898cbdc3200aa7..f1b27cce790cfd04e5d5dfe6192278d6a5114dc2 100644 (file)
@@ -602,7 +602,7 @@ fn parse_negotiation_request(input: &[u8]) -> IResult<&[u8], NegotiationRequest,
 /// x.224-spec, section 13.3
 fn parse_x224_connection_confirm(input: &[u8]) -> IResult<&[u8], X224ConnectionConfirm, RdpError> {
     let (i1, length) = verify!(input, be_u8, |&x| x != 0xff)?; // 0xff is reserved
-    let (i2, cr_cdt) = take_4_4_bits(input)?;
+    let (i2, cr_cdt) = take_4_4_bits(i1)?;
     let _ = verify!(i1, value!(cr_cdt.0), |&x| x
         == X224Type::ConnectionConfirm as u8)?;
     let _ = verify!(i1, value!(cr_cdt.1), |&x| x == 0 || x == 1)?;