Skip to content

Commit

Permalink
fix: sym readers should use cache readers as to not break DSC readers
Browse files Browse the repository at this point in the history
  • Loading branch information
blacktop committed Apr 6, 2024
1 parent d561ef0 commit d10da4c
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions file.go
Original file line number Diff line number Diff line change
Expand Up @@ -327,7 +327,7 @@ func NewFile(r io.ReaderAt, config ...FileConfig) (*File, error) {
} else {
symsz = 12
}
symdat, err := saferio.ReadDataAt(r, uint64(hdr.Nsyms)*uint64(symsz), int64(hdr.Symoff))
symdat, err := saferio.ReadDataAt(f.cr, uint64(hdr.Nsyms)*uint64(symsz), int64(hdr.Symoff))
if err != nil {
return nil, fmt.Errorf("failed to read data at Symoff=%#x; %v", int64(hdr.Symoff), err)
}
Expand Down Expand Up @@ -516,7 +516,7 @@ func NewFile(r io.ReaderAt, config ...FileConfig) (*File, error) {
"number of undefined symbols after index in dynamic symbol table command is greater than symbol table length (%d > %d)",
hdr.Iundefsym+hdr.Nundefsym, len(f.Symtab.Syms)), nil}
}
dat, err := saferio.ReadDataAt(r, uint64(hdr.Nindirectsyms)*4, int64(hdr.Indirectsymoff))
dat, err := saferio.ReadDataAt(f.cr, uint64(hdr.Nindirectsyms)*4, int64(hdr.Indirectsymoff))
if err != nil {
return nil, fmt.Errorf("failed to read data at Indirectsymoff @ %#x: %w", int64(hdr.Indirectsymoff), err)
}
Expand Down

0 comments on commit d10da4c

Please sign in to comment.