Skip to content

Commit 6573670

Browse files
committed
[squash] apply fix to BufferList
1 parent 5692736 commit 6573670

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

lib/internal/streams/BufferList.js

+5-1
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,10 @@
22

33
const Buffer = require('buffer').Buffer;
44

5+
function copyBuffer(src, target, offset) {
6+
Buffer.prototype.copy.call(src, target, offset);
7+
}
8+
59
module.exports = class BufferList {
610
constructor() {
711
this.head = null;
@@ -63,7 +67,7 @@ module.exports = class BufferList {
6367
var p = this.head;
6468
var i = 0;
6569
while (p) {
66-
p.data.copy(ret, i);
70+
copyBuffer(p.data, ret, i);
6771
i += p.data.length;
6872
p = p.next;
6973
}

0 commit comments

Comments
 (0)