An open-source remote desktop application designed for self-hosting, as an alternative to TeamViewer.
Rust androidanydeskdartflatpakflutterflutter-appsioslinuxmacosp2prdpremote-controlremote-desktoprustrust-langteamviewervncwaylandwindows
Fix, online state, validate the data length (#16339)
fufesouefec124c52dc
diff --git a/src/client.rs b/src/client.rsindex ca4c87470..ef468b60c 100644--- a/src/client.rs+++ b/src/client.rs@@ -5369,6 +5369,15 @@ pub mod peer_online {match msg_in.union {Some(rendezvous_message::Union::OnlineResponse(online_response)) => {let states = online_response.states;+ // One bit per ID, rounded up to whole bytes:+ // 0 IDs -> 0 bytes; 1..=8 -> 1; 9..=16 -> 2; 17..=24 -> 3.+ let required_len = ids.len().div_ceil(u8::BITS as usize);+ if states.len() < required_len {+ bail!(+ "Invalid online response: expected at least {required_len} state bytes, got {}",+ states.len()+ );+ }let mut onlines = Vec::new();let mut offlines = Vec::new();for i in 0..ids.len() {