From af8a786135e768c41e578525bfb0b18814930cc1 Mon Sep 17 00:00:00 2001 From: Robert Nagy Date: Fri, 23 Aug 2024 16:18:42 +0200 Subject: [PATCH] buffer: don't use Fast API for utf8 Fast API handles invalid UTF differently than the slow API. Fixes: https://github.com/nodejs/node/issues/54521 PR-URL: https://github.com/nodejs/node/pull/54525 --- src/node_buffer.cc | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) diff --git a/src/node_buffer.cc b/src/node_buffer.cc index 2cbcb5461e52d6..4312c578dc873a 100644 --- a/src/node_buffer.cc +++ b/src/node_buffer.cc @@ -1564,11 +1564,12 @@ void Initialize(Local target, "latin1WriteStatic", SlowWriteString, &fast_write_string); - SetFastMethod(context, - target, - "utf8WriteStatic", - SlowWriteString, - &fast_write_string); + // SetFastMethod(context, + // target, + // "utf8WriteStatic", + // SlowWriteString, + // &fast_write_string); + SetMethod(context, target, "utf8WriteStatic", SlowWriteString); SetMethod(context, target, "getZeroFillToggle", GetZeroFillToggle); }