From 9bb3ea42b5a251c180c00fe3bcfd96e7110fb890 Mon Sep 17 00:00:00 2001 From: Lucas Molas Date: Wed, 26 Aug 2020 12:53:22 -0300 Subject: [PATCH] fix: enforce maxlen in ReadByteArray() --- utils.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/utils.go b/utils.go index 632f8ed..d401469 100644 --- a/utils.go +++ b/utils.go @@ -470,7 +470,7 @@ func ReadByteArray(br io.Reader, maxlen uint64) ([]byte, error) { return nil, fmt.Errorf("expected cbor type 'byte string' in input") } - if extra > 256*1024 { + if extra > maxlen { return nil, fmt.Errorf("string in cbor input too long") } -- GitLab