diff --git a/src/memory.rs b/src/memory.rs index eee3ffc..5dc7abb 100644 --- a/src/memory.rs +++ b/src/memory.rs @@ -16,7 +16,7 @@ pub mod internal { } pub fn memory_bytes(handle: MemoryHandle) -> Vec { - let mut data = vec![0; handle.offset as usize]; + let mut data = vec![0; handle.length as usize]; unsafe { extism::load(handle.offset, &mut data) }; data }