Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 1 addition & 2 deletions librustzcash/zcash_primitives/src/bft.rs
Original file line number Diff line number Diff line change
Expand Up @@ -685,13 +685,12 @@ impl FatPointerToBftBlock {
buf
}

#[allow(clippy::reversed_empty_ranges)]
pub fn try_from_bytes(bytes: &[u8]) -> Option<Self> {
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;
Expand Down