From e856ce12a5ea7c99a782e9c226236576dd70a74f Mon Sep 17 00:00:00 2001 From: Kuba Kaflik Date: Thu, 17 Aug 2023 22:24:27 +0200 Subject: [PATCH] fix(proto.reader): remove str length limit --- proto/reader.go | 6 ------ 1 file changed, 6 deletions(-) diff --git a/proto/reader.go b/proto/reader.go index 4aa8f48d..fd521262 100644 --- a/proto/reader.go +++ b/proto/reader.go @@ -87,8 +87,6 @@ func (r *Reader) UVarInt() (uint64, error) { return n, nil } -const maxStrSize = 10 * 1024 * 1024 // 10 MB - func (r *Reader) StrLen() (int, error) { n, err := r.Int() if err != nil { @@ -98,10 +96,6 @@ func (r *Reader) StrLen() (int, error) { if n < 0 { return 0, errors.Errorf("size %d is invalid", n) } - if n > maxStrSize { - // Protecting from possible OOM. - return 0, errors.Errorf("size %d too big (%d is maximum)", n, maxStrSize) - } return n, nil }