From 1113879a345146b737994ed1361663c53025dbc2 Mon Sep 17 00:00:00 2001 From: Sharad Khanna Date: Fri, 30 Aug 2024 08:15:26 -0400 Subject: [PATCH] Fix i2srandreplace (#2504) --- libafl/src/mutators/token_mutations.rs | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/libafl/src/mutators/token_mutations.rs b/libafl/src/mutators/token_mutations.rs index c0055cf8d0..c39219a36c 100644 --- a/libafl/src/mutators/token_mutations.rs +++ b/libafl/src/mutators/token_mutations.rs @@ -472,7 +472,7 @@ where } CmpValues::U16(v) => { if len >= size_of::() { - for i in off..len - (size_of::() - 1) { + for i in off..=len - size_of::() { let val = u16::from_ne_bytes(bytes[i..i + size_of::()].try_into().unwrap()); if val == v.0 { @@ -501,7 +501,7 @@ where } CmpValues::U32(v) => { if len >= size_of::() { - for i in off..len - (size_of::() - 1) { + for i in off..=len - size_of::() { let val = u32::from_ne_bytes(bytes[i..i + size_of::()].try_into().unwrap()); if val == v.0 { @@ -530,7 +530,7 @@ where } CmpValues::U64(v) => { if len >= size_of::() { - for i in off..len - (size_of::() - 1) { + for i in off..=len - size_of::() { let val = u64::from_ne_bytes(bytes[i..i + size_of::()].try_into().unwrap()); if val == v.0 {