Skip to content
This repository was archived by the owner on Jan 23, 2023. It is now read-only.

Commit b853d88

Browse files
committed
Address PR feedback
Add a few comments.
1 parent 8c55a96 commit b853d88

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

src/System.IO.Compression/src/System/IO/Compression/DeflateStream.cs

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -265,6 +265,8 @@ public override int Read(byte[] array, int offset, int count)
265265
}
266266
else if (bytes > _buffer.Length)
267267
{
268+
// The stream is either malicious or poorly implemented and returned a number of
269+
// bytes larger than the buffer supplied to it.
268270
throw new InvalidDataException(SR.GenericInvalidData);
269271
}
270272

@@ -378,6 +380,8 @@ private async Task<int> ReadAsyncCore(Task<int> readTask, byte[] array, int offs
378380
}
379381
else if (bytesRead > _buffer.Length)
380382
{
383+
// The stream is either malicious or poorly implemented and returned a number of
384+
// bytes larger than the buffer supplied to it.
381385
throw new InvalidDataException(SR.GenericInvalidData);
382386
}
383387

0 commit comments

Comments
 (0)