File tree Expand file tree Collapse file tree 1 file changed +2
-2
lines changed
src/Servers/Kestrel/Core/src/Internal/Http Expand file tree Collapse file tree 1 file changed +2
-2
lines changed Original file line number Diff line number Diff line change @@ -217,7 +217,7 @@ public void Advance(int bytes)
217
217
{
218
218
if ( bytes >= 0 )
219
219
{
220
- if ( _currentSegment . Length < _position + bytes )
220
+ if ( _currentSegment . Length - bytes < _position )
221
221
{
222
222
throw new ArgumentOutOfRangeException ( "Can't advance past buffer size." ) ;
223
223
}
@@ -227,7 +227,7 @@ public void Advance(int bytes)
227
227
}
228
228
else if ( _autoChunk )
229
229
{
230
- if ( bytes + _advancedBytesForChunk > _currentChunkMemory . Length - BeginChunkLengthMax - EndChunkLength )
230
+ if ( _advancedBytesForChunk > _currentChunkMemory . Length - BeginChunkLengthMax - EndChunkLength - bytes )
231
231
{
232
232
throw new ArgumentOutOfRangeException ( "Can't advance past buffer size." ) ;
233
233
}
You can’t perform that action at this time.
0 commit comments