Skip to content

Commit 92b187c

Browse files
authored
Relax decoder max array elements limit (#779)
1 parent 4db95d0 commit 92b187c

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

encoder/encoder.go

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,9 @@ func initEncAndDecModes() {
2929
panic(err)
3030
}
3131

32-
decMode, err = cbor.DecOptions{}.DecModeWithTags(ts)
32+
decMode, err = cbor.DecOptions{
33+
MaxArrayElements: 10485760, // Set to a reasonably high value, 10MiB
34+
}.DecModeWithTags(ts)
3335
if err != nil {
3436
panic(err)
3537
}

0 commit comments

Comments
 (0)