From: Jeff Lucovsky Date: Wed, 5 Aug 2020 13:56:58 +0000 (-0400) Subject: rust/rdp: Fix use of incorrect buffer X-Git-Tag: suricata-6.0.0-beta1~29 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=be57f6d3cc74f3bb1315439218c24a928cae7c48;p=thirdparty%2Fsuricata.git rust/rdp: Fix use of incorrect buffer This commit updates the connection confirmation parsing function to use the correct buffer when determining the packet type. --- diff --git a/rust/src/rdp/parser.rs b/rust/src/rdp/parser.rs index 847e3bbbb5..f1b27cce79 100644 --- a/rust/src/rdp/parser.rs +++ b/rust/src/rdp/parser.rs @@ -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)?;