]> Cypherpunks repositories - gostls13.git/commit
debug/pe: omit panic in (*File).ImportedSymbols on empty optional headers
authorTobias Klauser <tklauser@distanz.ch>
Fri, 15 Feb 2019 11:15:11 +0000 (12:15 +0100)
committerTobias Klauser <tobias.klauser@gmail.com>
Wed, 27 Feb 2019 08:10:00 +0000 (08:10 +0000)
commit8da1b01e4c850d7cfbcdf5294e90d893e91a6a27
tree3dcdf3feb3b0e25335b572c5669077398cfc1e05
parent5a1c7b5841270f9f1b2836aa1d23b289ec24fdc2
debug/pe: omit panic in (*File).ImportedSymbols on empty optional headers

If a PE file with invalid optional header size (neither
sizeofOptionalHeader32 nor sizeofOptionalHeader64) is passed to NewFile,
the File.OptionalHeader will be nil which leads to a panic in
(*File).ImportedSymbols().

Fixes #30250

Change-Id: Ie97306de4a0e2dcfdc7b1b599891f574aa63adca
Reviewed-on: https://go-review.googlesource.com/c/162858
Run-TryBot: Tobias Klauser <tobias.klauser@gmail.com>
TryBot-Result: Gobot Gobot <gobot@golang.org>
Reviewed-by: Alex Brainman <alex.brainman@gmail.com>
src/debug/pe/file.go
src/debug/pe/file_test.go