Skip to content

Commit

Permalink
fix: Use handle.length instead of offset.
Browse files Browse the repository at this point in the history
  • Loading branch information
milesj authored Aug 13, 2024
1 parent e70b0d6 commit cf9368f
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/memory.rs
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ pub mod internal {
}

pub fn memory_bytes(handle: MemoryHandle) -> Vec<u8> {
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
}
Expand Down

0 comments on commit cf9368f

Please sign in to comment.