elodina / go-avro

Apache Avro for Golang
http://elodina.github.io/go-avro/
Apache License 2.0
129 stars 55 forks source link

Avoids runtime panic out of bounds error when decoding unionised enums #61

Closed user-dotcom closed 8 years ago

user-dotcom commented 8 years ago

When decoding unionised enumerable types, datum reader can encounter the following overflow: -

2015/12/08 14:48:02 http: panic serving 127.0.0.1:59482: runtime error: index out of range
goroutine 41 [running]:
net/http.(*conn).serve.func1(0xc8200dc0b0, 0xe64bc0, 0xc82002c1c0)
    /usr/local/Cellar/go/1.5.1/libexec/src/net/http/server.go:1287 +0xb5
github.com/stealthly/go-avro.(*GenericDatumReader).mapUnion(0xc82005b8b8, 0xea0280, 0xc8201873c0, 0xea03c0, 0xc8201875c0, 0x0, 0x0, 0x0, 0x0)
serejja commented 8 years ago

Cool, thanks!