std: Fix typo in ELF section header iterator
The code accidentally used the phdr offset instead of the shdr one while iterating over the section headers. Fixes #6338
This commit is contained in:
committed by
Veikka Tuominen
parent
5e39ab4600
commit
c1c3212500
@@ -471,7 +471,7 @@ pub const SectionHeaderIterator = struct {
|
||||
|
||||
if (self.elf_header.is_64) {
|
||||
var shdr: Elf64_Shdr = undefined;
|
||||
const offset = self.elf_header.phoff + @sizeOf(@TypeOf(shdr)) * self.index;
|
||||
const offset = self.elf_header.shoff + @sizeOf(@TypeOf(shdr)) * self.index;
|
||||
try preadNoEof(self.file, mem.asBytes(&shdr), offset);
|
||||
|
||||
// ELF endianness matches native endianness.
|
||||
|
||||
Reference in New Issue
Block a user