Skip to content

Commit

Permalink
Fix: take control buffer offset/length into account again (denoland#3769
Browse files Browse the repository at this point in the history
)
  • Loading branch information
piscisaureus committed Jan 24, 2020
1 parent 9f1e423 commit a6a7253
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion core/bindings.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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(..) => &[],
};
Expand Down

0 comments on commit a6a7253

Please sign in to comment.