Skip to content

Commit 08f94ac

Browse files
committed
bit more feedback
1 parent e63dac4 commit 08f94ac

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

src/Servers/Kestrel/Core/src/Internal/Http/Http1OutputProducer.cs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -217,7 +217,7 @@ public void Advance(int bytes)
217217
{
218218
if (bytes >= 0)
219219
{
220-
if (_currentSegment.Length < _position + bytes)
220+
if (_currentSegment.Length - bytes < _position)
221221
{
222222
throw new ArgumentOutOfRangeException("Can't advance past buffer size.");
223223
}
@@ -227,7 +227,7 @@ public void Advance(int bytes)
227227
}
228228
else if (_autoChunk)
229229
{
230-
if (bytes + _advancedBytesForChunk > _currentChunkMemory.Length - BeginChunkLengthMax - EndChunkLength)
230+
if (_advancedBytesForChunk > _currentChunkMemory.Length - BeginChunkLengthMax - EndChunkLength - bytes)
231231
{
232232
throw new ArgumentOutOfRangeException("Can't advance past buffer size.");
233233
}

0 commit comments

Comments
 (0)