Skip to content

Commit 8c4e5b5

Browse files
author
Pranav Krishnamoorthy
committed
Merged PR 18778: Constrain the MemoryStream size
Constrain the MemoryStream size
1 parent c55dd95 commit 8c4e5b5

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

src/System.Web.Http.Owin/HttpMessageHandlerAdapter.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -275,7 +275,7 @@ private static async Task<HttpContent> CreateBufferedRequestContentAsync(IOwinRe
275275
}
276276
else
277277
{
278-
buffer = new MemoryStream(contentLength.Value);
278+
buffer = new MemoryStream(Math.Min(4 * 1024, contentLength.Value));
279279
}
280280

281281
cancellationToken.ThrowIfCancellationRequested();

0 commit comments

Comments
 (0)