From a6a7253df9129b51255d45bf996d9a335c809ace Mon Sep 17 00:00:00 2001 From: Bert Belder Date: Fri, 24 Jan 2020 05:34:55 +0100 Subject: [PATCH] Fix: take control buffer offset/length into account again (#3769) --- core/bindings.rs | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/core/bindings.rs b/core/bindings.rs index c6882ed5a1..1c146934b6 100644 --- a/core/bindings.rs +++ b/core/bindings.rs @@ -396,8 +396,11 @@ fn send( let control = match v8::Local::::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(..) => &[], };