diff --git a/utils.go b/utils.go index 632f8ed1e8d189e79c01ec6a05b08e3371d1c0e6..729dd30909ad63cdcc153bf1d1c98c40d0f557fc 100644 --- a/utils.go +++ b/utils.go @@ -470,8 +470,8 @@ func ReadByteArray(br io.Reader, maxlen uint64) ([]byte, error) { return nil, fmt.Errorf("expected cbor type 'byte string' in input") } - if extra > 256*1024 { - return nil, fmt.Errorf("string in cbor input too long") + if extra > maxlen { + return nil, fmt.Errorf("string in cbor input too long, maxlen: %d", maxlen) } buf := make([]byte, extra)