Skip to content

Commit

Permalink
Merge pull request #278 from blinklabs-io/fix/cbor-max-nested-levels
Browse files Browse the repository at this point in the history
fix: increase max nested levels for CBOR decoding
  • Loading branch information
agaffney authored May 21, 2023
2 parents 6e401b9 + 06a466c commit 645052f
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions cbor/decode.go
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,8 @@ func Decode(dataBytes []byte, dest interface{}) (int, error) {
// Create a custom decoder that returns an error on unknown fields
decOptions := _cbor.DecOptions{
ExtraReturnErrors: _cbor.ExtraDecErrorUnknownField,
// This defaults to 32, but there are blocks in the wild using >64 nested levels
MaxNestedLevels: 256,
}
decMode, err := decOptions.DecMode()
if err != nil {
Expand Down

0 comments on commit 645052f

Please sign in to comment.