Fix some broken Stream.Read calls.
Change callers of this method to use the ReadBytes extension method that ensures the requested amount of bytes are consumed. Also tighten argument validation.
This commit is contained in:
@@ -28,6 +28,8 @@ namespace OpenRA
|
||||
|
||||
public static void ReadBytes(this Stream s, byte[] buffer, int offset, int count)
|
||||
{
|
||||
if (count < 0)
|
||||
throw new ArgumentOutOfRangeException("count", "Non-negative number required.");
|
||||
while (count > 0)
|
||||
{
|
||||
int bytesRead;
|
||||
|
||||
Reference in New Issue
Block a user