mirror of
https://github.com/golang/go.git
synced 2025-10-19 11:03:18 +00:00
debug/elf: don't panic if symtab too small
No test case because the problem can only happen for invalid data. Let the fuzzer find cases like this. For #47653 Fixes #75130 Change-Id: Ie6015564bb98334377383bbc16d79119dc4e36f9 Reviewed-on: https://go-review.googlesource.com/c/go/+/698855 Reviewed-by: Tobias Klauser <tobias.klauser@gmail.com> Auto-Submit: Ian Lance Taylor <iant@golang.org> Reviewed-by: Carlos Amedee <carlos@golang.org> LUCI-TryBot-Result: Go LUCI <golang-scoped@luci-project-accounts.iam.gserviceaccount.com> Reviewed-by: Cherry Mui <cherryyz@google.com> Reviewed-by: Florian Lehner <lehner.florian86@gmail.com>
This commit is contained in:
parent
2ee4b31242
commit
765905e3bd
1 changed files with 3 additions and 0 deletions
|
@ -692,6 +692,9 @@ func (f *File) getSymbols64(typ SectionType) ([]Symbol, []byte, error) {
|
|||
if len(data)%Sym64Size != 0 {
|
||||
return nil, nil, errors.New("length of symbol section is not a multiple of Sym64Size")
|
||||
}
|
||||
if len(data) == 0 {
|
||||
return nil, nil, ErrNoSymbols
|
||||
}
|
||||
|
||||
strdata, err := f.stringTable(symtabSection.Link)
|
||||
if err != nil {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue