From be57f6d3cc74f3bb1315439218c24a928cae7c48 Mon Sep 17 00:00:00 2001 From: Jeff Lucovsky Date: Wed, 5 Aug 2020 09:56:58 -0400 Subject: [PATCH] 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. --- rust/src/rdp/parser.rs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) 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)?; -- 2.47.2