From 69a58fc911413722779226664a5a858b84758f94 Mon Sep 17 00:00:00 2001 From: Kale Blankenship Date: Thu, 11 Jan 2018 19:06:40 -0800 Subject: [PATCH] Correct lookup table size (caught by go-fuzz) --- decode.go | 2 +- fuzz_test.go | 5 +++++ 2 files changed, 6 insertions(+), 1 deletion(-) diff --git a/decode.go b/decode.go index 167150e2..1752e617 100644 --- a/decode.go +++ b/decode.go @@ -681,7 +681,7 @@ func readComposite(r reader) (interface{}, error) { return unmarshal(r, iface) } -var compositeTypes = [255]func() interface{}{ +var compositeTypes = [256]func() interface{}{ typeCodeError: func() interface{} { return new(Error) }, typeCodeDeleteOnClose: func() interface{} { return deleteOnClose }, typeCodeDeleteOnNoMessages: func() interface{} { return deleteOnNoMessages }, diff --git a/fuzz_test.go b/fuzz_test.go index 1543fd44..8c5e6fc2 100644 --- a/fuzz_test.go +++ b/fuzz_test.go @@ -332,6 +332,11 @@ func TestFuzzConnCrashers(t *testing.T) { "\xdb\xf1\xbd\xbfwCB@P\x01\x00S(\xc0\x1a\v\xa1\x05/t" + "est@@@@@@@@@@@@@C\x80\x00\x00" + "\x00\x80\x00\x04\x10\x00@@@", + 24: "\x00\x00\x00d\x02\x00\x00\x00\x00S\x12\xc0\x00\x0e\xa1(p\xbd\xbf\xef" + + "\xbd\xdf\uf03d\xbfソソソ\xef\xff\xff\xff\x80" + + "\xbd\xbfソソ\x00\x02BrXfdw`@CB" + + "@P\x01\x00`S(\xc0\x12\v\xa1\x05./est`@@" + + "@`\x80@@@@@\x00P\xff\x00\x00\x00@@@`@\x00", } for i, tt := range tests {