Skip to content

Commit

Permalink
Relax decoder max array elements limit (#779)
Browse files Browse the repository at this point in the history
  • Loading branch information
omerfirmak authored May 25, 2023
1 parent 4db95d0 commit 92b187c
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion encoder/encoder.go
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,9 @@ func initEncAndDecModes() {
panic(err)
}

decMode, err = cbor.DecOptions{}.DecModeWithTags(ts)
decMode, err = cbor.DecOptions{
MaxArrayElements: 10485760, // Set to a reasonably high value, 10MiB
}.DecModeWithTags(ts)
if err != nil {
panic(err)
}
Expand Down

0 comments on commit 92b187c

Please sign in to comment.