Commit 03ca047d authored by Alex Brainman's avatar Alex Brainman

debug/pe: do not create symbol table if FileHeader.PointerToSymbolTable is 0

https://github.com/tpn/pdfs/raw/master/Microsoft Portable Executable and Common Object File Format Specification - 1999 (pecoff).doc
says this about PointerToSymbolTable:

File offset of the COFF symbol table or 0 if none is present.

Do as it says.

Fixes #17809.

Change-Id: Ib1ad83532f36a3e56c7e058dc9b2acfbf60c4e72
Reviewed-on: https://go-review.googlesource.com/33170Reviewed-by: default avatarIan Lance Taylor <iant@golang.org>
Run-TryBot: Alex Brainman <alex.brainman@gmail.com>
TryBot-Result: Gobot Gobot <gobot@golang.org>
parent dadfd14b
...@@ -23,6 +23,9 @@ type COFFSymbol struct { ...@@ -23,6 +23,9 @@ type COFFSymbol struct {
} }
func readCOFFSymbols(fh *FileHeader, r io.ReadSeeker) ([]COFFSymbol, error) { func readCOFFSymbols(fh *FileHeader, r io.ReadSeeker) ([]COFFSymbol, error) {
if fh.PointerToSymbolTable == 0 {
return nil, nil
}
if fh.NumberOfSymbols <= 0 { if fh.NumberOfSymbols <= 0 {
return nil, nil return nil, nil
} }
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment