Skip to content

Commit

Permalink
Fix bug when passing a typed array buffer with an offset to send
Browse files Browse the repository at this point in the history
  • Loading branch information
gfodor committed Aug 1, 2022
1 parent 6bb5f5a commit 3b39885
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/p2pcf.js
Original file line number Diff line number Diff line change
Expand Up @@ -873,7 +873,7 @@ export default class P2PCF extends EventEmitter {
if (msg.buffer.byteLength === msg.length) {
dataArrBuffer = msg.buffer
} else {
dataArrBuffer = msg.buffer.slice(msg.byteOffset, msg.byteLength)
dataArrBuffer = msg.buffer.slice(msg.byteOffset, msg.byteOffset + msg.byteLength)
}
} else {
throw new Error('Unsupported send data type', msg)
Expand Down

0 comments on commit 3b39885

Please sign in to comment.