Skip to content

Commit

Permalink
Return Error::Overflow in decode.rs
Browse files Browse the repository at this point in the history
  • Loading branch information
eval-exec committed Nov 8, 2023
1 parent 160ef4d commit 389e214
Showing 1 changed file with 1 addition and 4 deletions.
5 changes: 1 addition & 4 deletions src/decode.rs
Original file line number Diff line number Diff line change
Expand Up @@ -227,10 +227,7 @@ pub fn hex_decode_with_case(
dst: &mut [u8],
check_case: CheckCase,
) -> Result<(), Error> {
let len = dst
.len()
.checked_mul(2)
.ok_or(Error::InvalidLength(dst.len()))?;
let len = dst.len().checked_mul(2).ok_or(Error::Overflow)?;
if src.len() < len || ((src.len() & 1) != 0) {
return Err(Error::InvalidLength(len));
}
Expand Down

0 comments on commit 389e214

Please sign in to comment.