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.
pull/5276/head
Jeff Lucovsky 5 years ago committed by Victor Julien
parent 2529eb35e1
commit be57f6d3cc

@ -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)?;

Loading…
Cancel
Save