Skip to content

Commit

Permalink
fix(evm): don't panic on short calldata (#6380)
Browse files Browse the repository at this point in the history
  • Loading branch information
DaniPopes authored Nov 21, 2023
1 parent 7b45265 commit 9fab5bf
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions crates/evm/evm/src/executors/fuzz/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -166,8 +166,11 @@ impl<'a> FuzzedExecutor<'a> {
let reason = reason.to_string();
result.reason = if reason.is_empty() { None } else { Some(reason) };

let args =
func.abi_decode_input(&calldata.as_ref()[4..], false).unwrap_or_default();
let args = if let Some(data) = calldata.get(4..) {
func.abi_decode_input(data, false).unwrap_or_default()
} else {
vec![]
};
result.counterexample = Some(CounterExample::Single(BaseCounterExample {
sender: None,
addr: None,
Expand Down

0 comments on commit 9fab5bf

Please sign in to comment.