From 48d10ad1383e6ffa3c03b65a0d8053c980941af9 Mon Sep 17 00:00:00 2001 From: Michael Rodler Date: Wed, 27 Oct 2021 12:16:53 +0200 Subject: [PATCH] fixed formatting --- ethabi/src/decoder.rs | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/ethabi/src/decoder.rs b/ethabi/src/decoder.rs index 020dcd0aa..c55ffb813 100644 --- a/ethabi/src/decoder.rs +++ b/ethabi/src/decoder.rs @@ -165,9 +165,9 @@ fn decode_param(param: &ParamType, data: &[u8], offset: usize) -> Result data.len() { - return Err(Error::InvalidData); - } + if offset > data.len() { + return Err(Error::InvalidData); + } (&data[offset..], 0) } else { (data, offset)