From 72d113d9d023bba212da307e30b8e02bfe085368 Mon Sep 17 00:00:00 2001 From: Yilun Date: Wed, 27 May 2020 07:07:47 -0700 Subject: [PATCH] Reduce max message size from max uint32 to max int32 Signed-off-by: Yilun --- encoding.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/encoding.go b/encoding.go index e8cda6b..27269e4 100644 --- a/encoding.go +++ b/encoding.go @@ -26,7 +26,7 @@ func readVarBytes(reader io.Reader, b, lenBuf []byte) (int, error) { } func writeVarBytes(writer io.Writer, b, lenBuf []byte) error { - if len(b) > math.MaxUint32 { + if len(b) > math.MaxInt32 { return errors.New("data size too large") }