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:
RoosterDragon
2015-02-23 19:40:16 +00:00
parent 85fae8720d
commit d4421f0a41
2 changed files with 5 additions and 3 deletions

View File

@@ -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;