Skip to content

Commit

Permalink
Reduce max message size from max uint32 to max int32
Browse files Browse the repository at this point in the history
Signed-off-by: Yilun <zyl.skysniper@gmail.com>
  • Loading branch information
yilunzhang committed May 27, 2020
1 parent 3af4c28 commit 72d113d
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion encoding.go
Original file line number Diff line number Diff line change
Expand Up @@ -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")
}

Expand Down

0 comments on commit 72d113d

Please sign in to comment.