GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • Sign in
  • ActionsCI/CD and automation
  • CodespacesCloud development environments
  • All Features
  • Documentation
  • Training
  • Certifications
  • Build with Copilot
  • Customize Copilot
  • Integrations
  • Trending repos
  • GitHub Sponsors
  • Developer articles
  • Enterprises

This view

  • Original page
  • New address

GeezerVison is showing github.com — buffer: make decodeUTF8 params loose · nodejs/node@bfcf4f0

File tree

Expand file treeCollapse file tree
Open diff view settings
Filter options
  • src
    • node_buffer.cc
Expand file treeCollapse file tree
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)
You are visitor 01402503 — GeezerVison does not store the pages you look up.
Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required.