Skip to content

Commit

Permalink
fix: length check
Browse files Browse the repository at this point in the history
  • Loading branch information
loocapro committed Nov 11, 2023
1 parent 88da0a6 commit 0eb83ec
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions src/support/ssz.rs
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,12 @@ impl<const BITS: usize, const LIMBS: usize> Decode for Uint<BITS, LIMBS> {
}

Check warning on line 32 in src/support/ssz.rs

View check run for this annotation

Codecov / codecov/patch

src/support/ssz.rs#L30-L32

Added lines #L30 - L32 were not covered by tests

fn from_ssz_bytes(bytes: &[u8]) -> Result<Self, DecodeError> {
if bytes.len() > nbytes(BITS) {
return Err(DecodeError::InvalidByteLength {
len: bytes.len(),
expected: nbytes(BITS),
});

Check warning on line 39 in src/support/ssz.rs

View check run for this annotation

Codecov / codecov/patch

src/support/ssz.rs#L36-L39

Added lines #L36 - L39 were not covered by tests
}
Ok(Self::from_le_slice(bytes))
}
}
Expand Down

0 comments on commit 0eb83ec

Please sign in to comment.