diff --git a/src/debug/macho/file.go b/src/debug/macho/file.go index ecde25ab891..9806c270bfa 100644 --- a/src/debug/macho/file.go +++ b/src/debug/macho/file.go @@ -323,8 +323,8 @@ func NewFile(r io.ReaderAt) (*File, error) { if err := binary.Read(b, bo, &hdr); err != nil { return nil, err } - strtab := make([]byte, hdr.Strsize) - if _, err := r.ReadAt(strtab, int64(hdr.Stroff)); err != nil { + strtab, err := saferio.ReadDataAt(r, uint64(hdr.Strsize), int64(hdr.Stroff)) + if err != nil { return nil, err } var symsz int