From ce14e40968fcc1ed3257d240f0ed55923e15f290 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jon=20H=C3=A4ggblad?= Date: Tue, 15 Nov 2022 11:24:29 +0100 Subject: [PATCH] websocket-requests: fix deserialize length check --- clients/native/websocket-requests/src/requests.rs | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/clients/native/websocket-requests/src/requests.rs b/clients/native/websocket-requests/src/requests.rs index ea44059250..565a184df9 100644 --- a/clients/native/websocket-requests/src/requests.rs +++ b/clients/native/websocket-requests/src/requests.rs @@ -62,10 +62,10 @@ impl ClientRequest { .collect() } - // SEND_REQUEST_TAG || with_reply || recipient || data_len || data + // SEND_REQUEST_TAG || with_reply || recipient || conn_id || data_len || data fn deserialize_send(b: &[u8]) -> Result { - // we need to have at least 1 (tag) + 1 (reply flag) + Recipient::LEN + sizeof bytes - if b.len() < 2 + Recipient::LEN + size_of::() { + // we need to have at least 1 (tag) + 1 (reply flag) + Recipient::LEN + 2*sizeof bytes + if b.len() < 2 + Recipient::LEN + 2 * size_of::() { return Err(error::Error::new( ErrorKind::TooShortRequest, "not enough data provided to recover 'send'".to_string(),