diff --git a/common/src/net/post2.rs b/common/src/net/post2.rs index d864b66055..55cf64c3ee 100644 --- a/common/src/net/post2.rs +++ b/common/src/net/post2.rs @@ -267,9 +267,9 @@ impl PostBox { for _ in 0..100 { match incoming_buf.get(0..9) { Some(len_bytes) => { - let len = usize::from_le_bytes( + let len = u64::from_le_bytes( <[u8; 8]>::try_from(&len_bytes[0..8]).unwrap(), - ); // Can't fail + ) as usize; // Can't fail if len > MAX_MSG_SIZE { recv_tx.send(Err(Error::InvalidMessage)).unwrap();