-
Notifications
You must be signed in to change notification settings - Fork 160
Closed
Description
The following snippet breaks when contents is an empty array. Seems like bounds checking on sourceIndex and offset aren't correct for 0 length ArrayBuffer.
public IArrayBuffer CreateJsBuffer(byte[] contents) {
var buf = (IArrayBuffer)((ScriptObject)engine.Evaluate("ArrayBuffer")).Invoke(true, [contents.Length]);
buf.WriteBytes(contents, 0, (ulong)contents.Length, 0);
return buf;
}Specified argument was out of the range of valid values. (Parameter 'offset') Error: Specified argument was out of the range of valid values. (Parameter 'offset')
isaksky