From 41c2d89b1745beeb16c59a11e9bd8a6da1e518c7 Mon Sep 17 00:00:00 2001 From: Robert Nagy Date: Thu, 15 Aug 2024 08:17:05 +0200 Subject: [PATCH] buffer: properly apply offset on fast path PR-URL: https://github.com/nodejs/node/pull/54391 --- src/node_buffer.cc | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/node_buffer.cc b/src/node_buffer.cc index 0e1881eeb5f16d..d9745af160136d 100644 --- a/src/node_buffer.cc +++ b/src/node_buffer.cc @@ -1481,7 +1481,7 @@ uint32_t FastWriteString(Local receiver, max_length = std::min(dst.length() - offset, max_length); - memcpy(dst_data, src.data, max_length); + memcpy(dst_data + offset, src.data, max_length); return max_length; }