Skip to content

Commit c829552

Browse files
committed
fixup! fixup! dgram: fix send with out of bounds offset + length
1 parent b392a94 commit c829552

File tree

1 file changed

+4
-3
lines changed

1 file changed

+4
-3
lines changed

test/parallel/test-dgram-send-bad-arguments.js

+4-3
Original file line numberDiff line numberDiff line change
@@ -78,15 +78,16 @@ function checkArgs(connected) {
7878
}
7979
);
8080

81+
const longArray = [1, 2, 3, 4, 5, 6, 7, 8];
8182
for (const input of ['hello',
8283
Buffer.from('hello'),
8384
Buffer.from('hello world').subarray(0, 5),
8485
Buffer.from('hello world').subarray(4, 9),
8586
Buffer.from('hello world').subarray(6),
8687
new Uint8Array([1, 2, 3, 4, 5]),
87-
new Uint8Array([1, 2, 3, 4, 5, 6, 7, 8]).slice(0, 5),
88-
new Uint8Array([1, 2, 3, 4, 5, 6, 7, 8]).slice(2, 7),
89-
new Uint8Array([1, 2, 3, 4, 5, 6, 7, 8]).slice(3),
88+
new Uint8Array(longArray).subarray(0, 5),
89+
new Uint8Array(longArray).subarray(2, 7),
90+
new Uint8Array(longArray).subarray(3),
9091
new DataView(new ArrayBuffer(5), 0),
9192
new DataView(new ArrayBuffer(6), 1),
9293
new DataView(new ArrayBuffer(7), 1, 5)]) {

0 commit comments

Comments
 (0)