This PR adds pre check for msg size before make a slice.
We have encountered a panic in make([]byte, msgSize) with panic: runtime error: makeslice: len out of range. We have bounded the max message size by 20MB. So, it seems that make function should not panic.
I have test that when make with a negative length, make will panic with panic: runtime error: makeslice: len out of range.
This PR adds pre check for msg size before
make
a slice.We have encountered a panic in
make([]byte, msgSize)
withpanic: runtime error: makeslice: len out of range
. We have bounded the max message size by 20MB. So, it seems that make function should not panic.I have test that when
make
with a negative length,make
will panic withpanic: runtime error: makeslice: len out of range
.