Skip to content

Commit c77788f

Browse files
committed
buffer: don't use Fast API for utf8
Fast API handles invalid UTF differently than the slow API. Fixes: #54521 Refs: #54525
1 parent d5dc540 commit c77788f

File tree

1 file changed

+6
-5
lines changed

1 file changed

+6
-5
lines changed

src/node_buffer.cc

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1564,11 +1564,12 @@ void Initialize(Local<Object> target,
15641564
"latin1WriteStatic",
15651565
SlowWriteString<LATIN1>,
15661566
&fast_write_string);
1567-
SetFastMethod(context,
1568-
target,
1569-
"utf8WriteStatic",
1570-
SlowWriteString<UTF8>,
1571-
&fast_write_string);
1567+
// SetFastMethod(context,
1568+
// target,
1569+
// "utf8WriteStatic",
1570+
// SlowWriteString<UTF8>,
1571+
// &fast_write_string);
1572+
SetMethod(context, target, "utf8WriteStatic", SlowWriteString<UTF8>);
15721573

15731574
SetMethod(context, target, "getZeroFillToggle", GetZeroFillToggle);
15741575
}

0 commit comments

Comments
 (0)