From 097cdb66f965700caeea5659ff7fe4a129b84838 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Marc-Andr=C3=A9=20Lureau?= Date: Wed, 12 Mar 2025 16:30:53 +0400 Subject: [PATCH] fix(pdu): TS_RFX_CHANNELT width/height SHOULD be within range MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit According to the specification, the value does not need to be in the range: https://learn.microsoft.com/en-us/openspecs/windows_protocols/ms-rdprfx/4060f07e-9d73-454d-841e-131a93aca675 (the ironrdp-server can send larger values) Signed-off-by: Marc-André Lureau --- .../ironrdp-pdu/src/codecs/rfx/header_messages.rs | 13 ++----------- 1 file changed, 2 insertions(+), 11 deletions(-) diff --git a/crates/ironrdp-pdu/src/codecs/rfx/header_messages.rs b/crates/ironrdp-pdu/src/codecs/rfx/header_messages.rs index 4cd57028..4d021ee9 100644 --- a/crates/ironrdp-pdu/src/codecs/rfx/header_messages.rs +++ b/crates/ironrdp-pdu/src/codecs/rfx/header_messages.rs @@ -232,17 +232,8 @@ impl<'de> Decode<'de> for RfxChannel { return Err(invalid_field_err!("channelId", "Invalid channel ID")); } - let width = src.read_i16(); - if !(1..=4096).contains(&width) { - return Err(invalid_field_err!("width", "Invalid channel width")); - } - let width = RfxChannelWidth::new(width); - - let height = src.read_i16(); - if !(1..=2048).contains(&height) { - return Err(invalid_field_err!("height", "Invalid channel height")); - } - let height = RfxChannelHeight::new(height); + let width = RfxChannelWidth::new(src.read_i16()); + let height = RfxChannelHeight::new(src.read_i16()); Ok(Self { width, height }) }