mirror of
https://github.com/cefsharp/CefSharp.git
synced 2026-12-06 12:09:40 +00:00
Core - ByteArrayResourceHandler throw exception if byte[] length 0
We cannot create a CefStreamReader when buffer length is 0 CefStreamReader::CreateForData returns null and CefStreamResourceHandler crashes as the stream is null https://github.com/chromiumembedded/cef/blob/9df4a54308a88fd80c5774d91c62da35afb5fd1b/libcef/browser/stream_impl.cc#L27 https://github.com/chromiumembedded/cef/blob/a94dc6a0588e15deb184650b9015cd259e52a702/libcef_dll/wrapper/cef_stream_resource_handler.cc#L79
This commit is contained in:
@@ -43,6 +43,11 @@ namespace CefSharp
|
||||
throw new ArgumentNullException("data", "Please provide a valid array");
|
||||
}
|
||||
|
||||
if (data.Length == 0)
|
||||
{
|
||||
throw new Exception("Unable to load byte[] with length 0.");
|
||||
}
|
||||
|
||||
MimeType = mimeType;
|
||||
Data = data;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user