Skip to content

Commit

Permalink
fix: seek file before use
Browse files Browse the repository at this point in the history
  • Loading branch information
Zxilly committed Sep 15, 2024
1 parent 8a9899d commit 91ec4e4
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion file.go
Original file line number Diff line number Diff line change
Expand Up @@ -442,7 +442,13 @@ func (f *GoFile) PCLNTab() (*gosym.Table, error) {
}

func (f *GoFile) findRuntimeTextMachoChainedFixups(pclntabAddr uint64) (uint64, error) {
f2, err := macho2.NewFile(f.fh.getFile())
of := f.fh.getFile()
_, err := of.Seek(0, io.SeekStart)
if err != nil {
return 0, err
}

f2, err := macho2.NewFile(of)
if err != nil {
return 0, err
}
Expand Down

0 comments on commit 91ec4e4

Please sign in to comment.