From c8295526df2ae0e8f900afc68ea0f1116d1fa146 Mon Sep 17 00:00:00 2001 From: Nitzan Uziely Date: Sun, 24 Oct 2021 19:30:37 +0300 Subject: [PATCH] fixup! fixup! dgram: fix send with out of bounds offset + length --- test/parallel/test-dgram-send-bad-arguments.js | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/test/parallel/test-dgram-send-bad-arguments.js b/test/parallel/test-dgram-send-bad-arguments.js index 4a62166eb33de9..b30951d441cbd2 100644 --- a/test/parallel/test-dgram-send-bad-arguments.js +++ b/test/parallel/test-dgram-send-bad-arguments.js @@ -78,15 +78,16 @@ function checkArgs(connected) { } ); + const longArray = [1, 2, 3, 4, 5, 6, 7, 8]; for (const input of ['hello', Buffer.from('hello'), Buffer.from('hello world').subarray(0, 5), Buffer.from('hello world').subarray(4, 9), Buffer.from('hello world').subarray(6), new Uint8Array([1, 2, 3, 4, 5]), - new Uint8Array([1, 2, 3, 4, 5, 6, 7, 8]).slice(0, 5), - new Uint8Array([1, 2, 3, 4, 5, 6, 7, 8]).slice(2, 7), - new Uint8Array([1, 2, 3, 4, 5, 6, 7, 8]).slice(3), + new Uint8Array(longArray).subarray(0, 5), + new Uint8Array(longArray).subarray(2, 7), + new Uint8Array(longArray).subarray(3), new DataView(new ArrayBuffer(5), 0), new DataView(new ArrayBuffer(6), 1), new DataView(new ArrayBuffer(7), 1, 5)]) {