Skip to content

Commit 4e044fb

Browse files
authored
pe.reloc: fix parsing relocs loading 0 bytes (#496)
I tried using the reloc feature but it always just parsed an empty slice for the actual reloc byte contents.
1 parent 4bdcda3 commit 4e044fb

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

src/pe/relocation.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -380,8 +380,8 @@ impl<'a> RelocationData<'a> {
380380
)));
381381
}
382382

383-
let bytes = bytes[offset..]
384-
.pread::<&[u8]>(safe_available_size)
383+
let bytes = bytes
384+
.pread_with::<&[u8]>(offset, safe_available_size)
385385
.map_err(|_| {
386386
error::Error::Malformed(format!(
387387
"base reloc offset {:#x} and size {:#x} exceeds the bounds of the bytes size {:#x}",

0 commit comments

Comments
 (0)