Skip to content

Panic when ConnContext is not set #161

@yusing

Description

@yusing

If srv.h1.ConnContext is nil (unset), this line will cause panic

Originally posted by @yusing in #140

panic: runtime error: invalid memory address or nil pointer dereference
[signal SIGSEGV: segmentation violation code=0x1 addr=0x0 pc=0xe6f026]

goroutine 567 [running]:
github.com/pires/go-proxyproto/helper/http2.(*Server).serveConn(0xc0009d4230, {0x2321d10, 0xc0009b8e08}, {0x23147d8, 0xc0006965a0})
    /home/yusing/.local/go/pkg/mod/github.com/pires/go-proxyproto@v0.9.2/helper/http2/http2.go:161 +0x2c6
github.com/pires/go-proxyproto/helper/http2.(*Server).Serve.func2({0x2321d10?, 0xc0009b8e08?}, {0x23147d8?, 0xc0006965a0?})
    /home/yusing/.local/go/pkg/mod/github.com/pires/go-proxyproto@v0.9.2/helper/http2/http2.go:120 +0x69
created by github.com/pires/go-proxyproto/helper/http2.(*Server).Serve in goroutine 482
    /home/yusing/.local/go/pkg/mod/github.com/pires/go-proxyproto@v0.9.2/helper/http2/http2.go:119 +0x1af

Metadata

Metadata

Assignees

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions