Skip to content

Commit

Permalink
fix(js): the opposite checking logic (#232)
Browse files Browse the repository at this point in the history
Seems we're using the opposite judge logic to check the ending and
memory length. found in
https://github.com/paradigmxyz/revm-inspectors/actions/runs/11389609241/job/31689313431?pr=231

Signed-off-by: jsvisa <[email protected]>
  • Loading branch information
jsvisa authored Oct 17, 2024
1 parent d2976ff commit 1e06993
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/tracing/js/bindings.rs
Original file line number Diff line number Diff line change
Expand Up @@ -265,7 +265,7 @@ impl MemoryRef {
move |_this, args, memory, ctx| {
let start = args.get_or_undefined(0).to_number(ctx)?;
let end = args.get_or_undefined(1).to_number(ctx)?;
if end < start || start < 0. || (end as usize) < memory.len() {
if end < start || start < 0. || (end as usize) > memory.len() {
return Err(JsError::from_native(JsNativeError::typ().with_message(
format!(
"tracer accessed out of bound memory: offset {start}, end {end}"
Expand Down

0 comments on commit 1e06993

Please sign in to comment.