1
0
Fork 0
mirror of https://github.com/denoland/deno.git synced 2024-12-22 23:34:47 -05:00

Fix: take control buffer offset/length into account again (#3769)

This commit is contained in:
Bert Belder 2020-01-24 05:34:55 +01:00 committed by GitHub
parent 9f1e4237a5
commit a6a7253df9
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -396,8 +396,11 @@ fn send(
let control = match v8::Local::<v8::ArrayBufferView>::try_from(args.get(1)) {
Ok(view) => {
let byte_offset = view.byte_offset();
let byte_length = view.byte_length();
let backing_store = view.buffer().unwrap().get_backing_store();
unsafe { &**backing_store.get() }
let buf = unsafe { &**backing_store.get() };
&buf[byte_offset..byte_offset + byte_length]
}
Err(..) => &[],
};