Skip to content
This repository was archived by the owner on Dec 14, 2020. It is now read-only.

Commit 69a58fc

Browse files
committed
Correct lookup table size (caught by go-fuzz)
1 parent 2944649 commit 69a58fc

File tree

2 files changed

+6
-1
lines changed

2 files changed

+6
-1
lines changed

decode.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -681,7 +681,7 @@ func readComposite(r reader) (interface{}, error) {
681681
return unmarshal(r, iface)
682682
}
683683

684-
var compositeTypes = [255]func() interface{}{
684+
var compositeTypes = [256]func() interface{}{
685685
typeCodeError: func() interface{} { return new(Error) },
686686
typeCodeDeleteOnClose: func() interface{} { return deleteOnClose },
687687
typeCodeDeleteOnNoMessages: func() interface{} { return deleteOnNoMessages },

fuzz_test.go

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -332,6 +332,11 @@ func TestFuzzConnCrashers(t *testing.T) {
332332
"\xdb\xf1\xbd\xbfwCB@P\x01\x00S(\xc0\x1a\v\xa1\x05/t" +
333333
"est@@@@@@@@@@@@@C\x80\x00\x00" +
334334
"\x00\x80\x00\x04\x10\x00@@@",
335+
24: "\x00\x00\x00d\x02\x00\x00\x00\x00S\x12\xc0\x00\x0e\xa1(p\xbd\xbf\xef" +
336+
"\xbd\xdf\uf03d\xbfソソソ\xef\xff\xff\xff\x80" +
337+
"\xbd\xbfソソ\x00\x02BrXfdw`@CB" +
338+
"@P\x01\x00`S(\xc0\x12\v\xa1\x05./est`@@" +
339+
"@`\x80@@@@@\x00P\xff\x00\x00\x00@@@`@\x00",
335340
}
336341

337342
for i, tt := range tests {

0 commit comments

Comments
 (0)