diff --git a/websocket-sharp/Net/RequestStream.cs b/websocket-sharp/Net/RequestStream.cs index 26ff6d4a..69cef07c 100644 --- a/websocket-sharp/Net/RequestStream.cs +++ b/websocket-sharp/Net/RequestStream.cs @@ -148,7 +148,7 @@ namespace WebSocketSharp.Net if (count > _count) count = _count; - if (_bodyLeft > 0 && count > _bodyLeft) + if (_bodyLeft > 0 && _bodyLeft < count) count = (int) _bodyLeft; Buffer.BlockCopy (_buffer, _offset, buffer, offset, count);