Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

Commit bfcf4f0

Browse filesBrowse files
anonrigdanielleadams
authored andcommitted
buffer: make decodeUTF8 params loose
PR-URL: #45610 Reviewed-By: Anna Henningsen <anna@addaleax.net> Reviewed-By: Darshan Sen <raisinten@gmail.com>
1 parent e2da381 commit bfcf4f0
Copy full SHA for bfcf4f0

File tree

Expand file treeCollapse file tree

1 file changed

+2
-1
lines changed
Open diff view settings
Filter options
Expand file treeCollapse file tree

1 file changed

+2
-1
lines changed
Open diff view settings
Collapse file

‎src/node_buffer.cc‎

Copy file name to clipboardExpand all lines: src/node_buffer.cc
+2-1Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -570,6 +570,8 @@ void StringSlice(const FunctionCallbackInfo<Value>& args) {
570570
void DecodeUTF8(const FunctionCallbackInfo<Value>& args) {
571571
Environment* env = Environment::GetCurrent(args); // list, flags
572572

573+
CHECK_GE(args.Length(), 1);
574+
573575
if (!(args[0]->IsArrayBuffer() || args[0]->IsSharedArrayBuffer() ||
574576
args[0]->IsArrayBufferView())) {
575577
return node::THROW_ERR_INVALID_ARG_TYPE(
@@ -580,7 +582,6 @@ void DecodeUTF8(const FunctionCallbackInfo<Value>& args) {
580582

581583
ArrayBufferViewContents<char> buffer(args[0]);
582584

583-
CHECK(args[1]->IsBoolean());
584585
bool ignore_bom = args[1]->IsTrue();
585586

586587
const char* data = buffer.data();

0 commit comments

Comments
0 (0)
Morty Proxy This is a proxified and sanitized view of the page, visit original site.