From 500e5e40ec9f4134959cb468f5dd2b3e3e36421d Mon Sep 17 00:00:00 2001 From: Robert Nagy Date: Fri, 4 Oct 2024 11:25:44 +0200 Subject: [PATCH] fix: out of bounds copy Fixes: https://github.com/nodejs/node/issues/54573 --- lib/v8.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/v8.js b/lib/v8.js index b687d8709c99a0..b506d96139e33b 100644 --- a/lib/v8.js +++ b/lib/v8.js @@ -368,7 +368,7 @@ class DefaultDeserializer extends Deserializer { } // Copy to an aligned buffer first. const buffer_copy = Buffer.allocUnsafe(byteLength); - copy(this.buffer, buffer_copy, 0, byteOffset, byteOffset + byteLength); + copy(this.buffer, buffer_copy, 0, byteOffset, byteLength); return new ctor(buffer_copy.buffer, buffer_copy.byteOffset, byteLength / BYTES_PER_ELEMENT);