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

nil pointer dereference in State.UnmarshalBinary #591

Closed
0x34d opened this issue Oct 11, 2023 · 0 comments
Closed

nil pointer dereference in State.UnmarshalBinary #591

0x34d opened this issue Oct 11, 2023 · 0 comments

Comments

@0x34d
Copy link
Contributor

0x34d commented Oct 11, 2023

File : resume_test.go

func TestUnmarshalBinary(t *testing.T) {
	deserialized := &State{}
	_ = deserialized.UnmarshalBinary([]byte("\x01$"))
}

Run go test -run TestUnmarshalBinary .

Backtrace

--- FAIL: TestUnmarshalBinary (0.00s)
panic: runtime error: invalid memory address or nil pointer dereference [recovered]
	panic: runtime error: invalid memory address or nil pointer dereference
[signal SIGSEGV: segmentation violation code=0x1 addr=0x58 pc=0x6be89c]

goroutine 6 [running]:
testing.tRunner.func1.2({0x72c920, 0x9d2ae0})
	/usr/lib/golang/src/testing/testing.go:1526 +0x24e
testing.tRunner.func1()
	/usr/lib/golang/src/testing/testing.go:1529 +0x39f
panic({0x72c920, 0x9d2ae0})
	/usr/lib/golang/src/runtime/panic.go:884 +0x213
github.com/pion/dtls/v2.(*State).initCipherSuite(0xc0000aa780)
	/home/0x34d/project/dtls/state.go:161 +0x3c
github.com/pion/dtls/v2.(*State).UnmarshalBinary(0x4f7214?, {0xc00001a348, 0x2, 0x2})
	/home/0x34d/project/dtls/state.go:202 +0x132
github.com/pion/dtls/v2.TestUnmarshalBinary(0x0?)
	/home/0x34d/project/dtls/resume_test.go:216 +0x50
testing.tRunner(0xc0000c89c0, 0x7b5380)
	/usr/lib/golang/src/testing/testing.go:1576 +0x10b
created by testing.(*T).Run
	/usr/lib/golang/src/testing/testing.go:1629 +0x3ea
FAIL	github.com/pion/dtls/v2	0.007s
FAIL
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant