Skip to content

Commit 6a2175a

Browse files
committed
Core - ResourceHandler.Read only read as many bytes as can be written to DataOut
Previously we'd read too many bytes and attempting to write them to dataOUt would cause a see System.NotSupportedException Resolves #3038
1 parent 28d1d07 commit 6a2175a

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

CefSharp/ResourceHandler.cs

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -168,7 +168,8 @@ bool IResourceHandler.Read(Stream dataOut, out int bytesRead, IResourceReadCallb
168168
tempBuffer = new byte[dataOut.Length];
169169
}
170170

171-
bytesRead = Stream.Read(tempBuffer, 0, tempBuffer.Length);
171+
//Only read the number of bytes that can be written to dataOut
172+
bytesRead = Stream.Read(tempBuffer, 0, (int)dataOut.Length);
172173

173174
// To indicate response completion set bytesRead to 0 and return false
174175
if (bytesRead == 0)

0 commit comments

Comments
 (0)