From 0dabc343291031a3dcbdbce3e608971c8e3f5881 Mon Sep 17 00:00:00 2001 From: Scott <55210664+scottmpowell@users.noreply.github.com> Date: Tue, 3 Dec 2024 04:34:56 -0500 Subject: [PATCH] Fix assertion in snapshot module for pages that are equal to SNAPSHOT_PAGE_SIZE (#2738) Co-authored-by: Scott Powell --- libafl_qemu/src/modules/usermode/snapshot.rs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/libafl_qemu/src/modules/usermode/snapshot.rs b/libafl_qemu/src/modules/usermode/snapshot.rs index 4eabc858c2..6fbe33e541 100644 --- a/libafl_qemu/src/modules/usermode/snapshot.rs +++ b/libafl_qemu/src/modules/usermode/snapshot.rs @@ -257,7 +257,7 @@ impl SnapshotModule { pub fn access(&mut self, addr: GuestAddr, size: usize) { // ASSUMPTION: the access can only cross 2 pages - debug_assert!(size > 0 && size < SNAPSHOT_PAGE_SIZE); + debug_assert!(size > 0 && size <= SNAPSHOT_PAGE_SIZE); let page = addr & SNAPSHOT_PAGE_MASK; self.page_access(page); let second_page = (addr + size as GuestAddr - 1) & SNAPSHOT_PAGE_MASK;