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

go-fuzz found panic in GenericDatumReader union parsing #12

Open
crast opened this issue Dec 19, 2017 · 0 comments
Open

go-fuzz found panic in GenericDatumReader union parsing #12

crast opened this issue Dec 19, 2017 · 0 comments

Comments

@crast
Copy link
Contributor

crast commented Dec 19, 2017

After adding some annotation code:

panic: runtime error: index out of range [recovered]
	panic: TypedValue Panic -4 [A B C D]

goroutine 1 [running]:
gopkg.in/avro%2ev0.(*GenericDatumReader).findAndSet.func1(0xc420073e90)
	/gopath/src/gopkg.in/avro.v0/datum_reader.go:475 +0x1b1
panic(0x1133ea0, 0x120ade0)
	/goroot/src/runtime/panic.go:491 +0x283
gopkg.in/avro%2ev0.(*GenericDatumReader).findAndSet(0xc42000a710, 0xc42000ac40, 0xc4200803c0, 0x11fe880, 0xc42000ac00, 0x0, 0x0)
	/gopath/src/gopkg.in/avro.v0/datum_reader.go:478 +0x4a7
gopkg.in/avro%2ev0.(*GenericDatumReader).mapRecord(0xc42000a710, 0x11fd6e0, 0xc420090070, 0x11fe880, 0xc42000ac00, 0xc42003dd90, 0x100f2c7, 0xc420073e30)
	/gopath/src/gopkg.in/avro.v0/datum_reader.go:640 +0x1dd
gopkg.in/avro%2ev0.(*GenericDatumReader).readValue(0xc42000a710, 0x11fd6e0, 0xc420090070, 0x11fe880, 0xc42000ac00, 0x199, 0x105bee9, 0xc42003de20, 0x100fa28)
	/gopath/src/gopkg.in/avro.v0/datum_reader.go:516 +0x3aa
gopkg.in/avro%2ev0.(*GenericDatumReader).Read(0xc42000a710, 0x113cc00, 0xc42000ac20, 0x11fe880, 0xc42000ac00, 0x8, 0xc42003de90)
	/gopath/src/gopkg.in/avro.v0/datum_reader.go:445 +0x23c
gopkg.in/avro%2ev0.(*anyDatumReader).Read(0xc42000a700, 0x1120fa0, 0xc42000c0c0, 0x11fe880, 0xc42000ac00, 0x1066f96, 0x5a386079)
	/gopath/src/gopkg.in/avro.v0/datum_reader.go:110 +0x12b
gopkg.in/avro.v0/fuzzes/genericreader.Fuzz(0x12d2000, 0x3, 0x200000, 0x3)
	/gopath/src/gopkg.in/avro.v0/fuzzes/genericreader/genericfuzzer.go:15 +0xef
go-fuzz-dep.Main(0x115f0d0)
	/goroot/src/go-fuzz-dep/main.go:49 +0xad
main.main()
	/gopath/src/gopkg.in/avro.v0/fuzzes/genericreader/go.fuzz.main/main.go:10 +0x2d
exit status 2

This is because we're trying to set a union with index -4

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