aboutsummaryrefslogtreecommitdiff
path: root/src/debug/pe
diff options
context:
space:
mode:
authorAlex Brainman <alex.brainman@gmail.com>2016-11-12 17:57:35 +1100
committerAlex Brainman <alex.brainman@gmail.com>2016-11-17 07:55:06 +0000
commit03ca047dd334f6018f06f7fc9a7a4e2608b1f8d3 (patch)
tree8a7664e40556b3ec925ca72d2a7d40d688b0f29e /src/debug/pe
parentdadfd14babccc30757ddb3f3eb8fbb7cd3bf4b5a (diff)
downloadgo-03ca047dd334f6018f06f7fc9a7a4e2608b1f8d3.tar.xz
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/33170 Reviewed-by: Ian Lance Taylor <iant@golang.org> Run-TryBot: Alex Brainman <alex.brainman@gmail.com> TryBot-Result: Gobot Gobot <gobot@golang.org>
Diffstat (limited to 'src/debug/pe')
-rw-r--r--src/debug/pe/symbol.go3
1 files changed, 3 insertions, 0 deletions
diff --git a/src/debug/pe/symbol.go b/src/debug/pe/symbol.go
index b7d5d09bcf..7fa5948641 100644
--- a/src/debug/pe/symbol.go
+++ b/src/debug/pe/symbol.go
@@ -23,6 +23,9 @@ type COFFSymbol struct {
}
func readCOFFSymbols(fh *FileHeader, r io.ReadSeeker) ([]COFFSymbol, error) {
+ if fh.PointerToSymbolTable == 0 {
+ return nil, nil
+ }
if fh.NumberOfSymbols <= 0 {
return nil, nil
}