diff --git a/librustzcash/zcash_primitives/src/bft.rs b/librustzcash/zcash_primitives/src/bft.rs index 76d24069..0925f70c 100644 --- a/librustzcash/zcash_primitives/src/bft.rs +++ b/librustzcash/zcash_primitives/src/bft.rs @@ -685,13 +685,12 @@ impl FatPointerToBftBlock { buf } - #[allow(clippy::reversed_empty_ranges)] pub fn try_from_bytes(bytes: &[u8]) -> Option { if bytes.len() < 76 - 32 + 2 { return None; } let vote_for_block_without_finalizer_public_key = bytes[0..76 - 32].try_into().unwrap(); - let len = u16::from_le_bytes(bytes[76 - 32..2].try_into().unwrap()) as usize; + let len = u16::from_le_bytes(bytes[76 - 32..76 - 32 + 2].try_into().unwrap()) as usize; if 76 - 32 + 2 + len * (32 + 64) > bytes.len() { return None;