More robust integer comparison

This commit is contained in:
Sasha Koshka 2025-04-25 15:21:52 -04:00
parent f6fe9c307d
commit 87c4ac8efb

View File

@ -126,7 +126,7 @@ type Stream interface {
}
func encodeMessageB(writer io.Writer, sizeLimit int64, method uint16, data []byte) error {
if len(data) > int(sizeLimit) {
if int64(len(data)) > sizeLimit {
return ErrPayloadTooLarge
}
buffer := make([]byte, 10 + len(data))