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:
amaitland
2020-06-08 16:24:30 +10:00
parent 37a5193441
commit e290d5ab23
@@ -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;
}