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

Commit

Permalink
Correct lookup table size (caught by go-fuzz)
Browse files Browse the repository at this point in the history
  • Loading branch information
vcabbage committed Jan 12, 2018
1 parent 2944649 commit 69a58fc
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 1 deletion.
2 changes: 1 addition & 1 deletion decode.go
Original file line number Diff line number Diff line change
Expand Up @@ -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 },
Expand Down
5 changes: 5 additions & 0 deletions fuzz_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -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 {
Expand Down

0 comments on commit 69a58fc

Please sign in to comment.