Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

debug/pe: panic on interface conversion #30250

Closed
tklauser opened this issue Feb 15, 2019 · 1 comment
Closed

debug/pe: panic on interface conversion #30250

tklauser opened this issue Feb 15, 2019 · 1 comment
Milestone

Comments

@tklauser
Copy link
Member

go version devel +d6c5be54a674 Fri Feb 15 00:00:35 2019 +0100 linux/amd64

package main

import (
        "bytes"
        "debug/pe"
)

func main() {
        data := []byte("\x00\x00\x00\x0000000\x00\x00\x00\x00\x00\x00\x000000" +
                "00000000000000000000" +
                "000000000\x00\x00\x0000000000" +
                "00000000000000000000" +
                "0000000000000000")
        f, err := pe.NewFile(bytes.NewReader(data))
        if err != nil {
                return
        }
        defer f.Close()
        f.ImportedSymbols()
}

go run crash.go

panic: interface conversion: interface {} is nil, not *pe.OptionalHeader32

goroutine 1 [running]:
debug/pe.(*File).ImportedSymbols(0xc0000ba000, 0x4d7598, 0xc0000ba000, 0x0, 0x0, 0x498ba2)
	/go/src/debug/pe/file.go:336 +0xabb
main.main()
	/go/src/github.com/tklauser/go-fuzz-corpus/pe/repro.go:19 +0xf1
exit status 2

Found using go-fuzz (#19109)

@tklauser tklauser added this to the Go1.13 milestone Feb 15, 2019
@gopherbot
Copy link

Change https://golang.org/cl/162858 mentions this issue: debug/pe: reject invalid optional header size in NewFile

@golang golang locked and limited conversation to collaborators Feb 27, 2020
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

2 participants