Skip to content

Commit 38e373d

Browse files
committed
buffer: fix out of range for toString
nodejs/node#54553
1 parent 8be08b6 commit 38e373d

File tree

1 file changed

+14
-0
lines changed

1 file changed

+14
-0
lines changed

patches/node/support_v8_sandboxed_pointers.patch

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -298,3 +298,17 @@ index 9787b14352753c5e0f8dc2b90093680e7cd10f1a..31af9e62396368af1b81f8841a705fd3
298298
auto ab = ArrayBuffer::New(isolate, std::move(bs));
299299
v8::Local<Uint8Array> u8 = v8::Uint8Array::New(ab, 0, 1);
300300

301+
diff --git a/test/parallel/test-buffer-tostring-range.js b/test/parallel/test-buffer-tostring-range.js
302+
index 1167654dcf0773be953d09dfcf534e902e75595b..a769ec1fb61916d4285fa9d3559ded5df4f02e9e 100644
303+
--- a/test/parallel/test-buffer-tostring-range.js
304+
+++ b/test/parallel/test-buffer-tostring-range.js
305+
@@ -103,6 +103,8 @@ assert.throws(() => {
306+
// Cannot test on 32bit machine as we are testing the case
307+
// when start and end are above the threshold
308+
common.skipIf32Bits();
309+
+/* Disabled due to incompatiblity with v8 memory cage
310+
const threshold = 0xFFFFFFFF;
311+
const largeBuffer = Buffer.alloc(threshold);
312+
largeBuffer.toString('utf8', threshold + 0xF, threshold + 0xFF);
313+
+*/
314+
\ No newline at end of file

0 commit comments

Comments
 (0)