mirror of https://github.com/golang/go.git
debug/macho: use saferio to read dynamic indirect symbols
No test case because the problem can only happen for invalid data. Let the fuzzer find cases like this. For #47653 Fixes #58755 Change-Id: I5b95a21f47ec306ad90cd6221f0566c6f8b6c3ad Reviewed-on: https://go-review.googlesource.com/c/go/+/471835 Reviewed-by: Dmitri Shuralyov <dmitshur@google.com> Reviewed-by: Dmitri Shuralyov <dmitshur@golang.org> TryBot-Result: Gopher Robot <gobot@golang.org> Run-TryBot: Ian Lance Taylor <iant@golang.org> Reviewed-by: Ian Lance Taylor <iant@google.com> Run-TryBot: Ian Lance Taylor <iant@google.com> Auto-Submit: Ian Lance Taylor <iant@google.com>
This commit is contained in:
parent
41e8679611
commit
e8fbad5de8
|
|
@ -361,8 +361,8 @@ func NewFile(r io.ReaderAt) (*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 := make([]byte, hdr.Nindirectsyms*4)
|
||||
if _, err := r.ReadAt(dat, int64(hdr.Indirectsymoff)); err != nil {
|
||||
dat, err := saferio.ReadDataAt(r, uint64(hdr.Nindirectsyms)*4, int64(hdr.Indirectsymoff))
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
x := make([]uint32, hdr.Nindirectsyms)
|
||||
|
|
|
|||
Loading…
Reference in New Issue