diff --git a/src/node_buffer.cc b/src/node_buffer.cc index bb94263ccd5b64..b8accf517cd46f 100644 --- a/src/node_buffer.cc +++ b/src/node_buffer.cc @@ -1227,7 +1227,9 @@ void SetupBufferJS(const FunctionCallbackInfo& args) { if (auto zero_fill_field = env->isolate_data()->zero_fill_field()) { CHECK(args[1]->IsObject()); auto binding_object = args[1].As(); - auto array_buffer = ArrayBuffer::New(env->isolate(), zero_fill_field, 1); + auto array_buffer = ArrayBuffer::New(env->isolate(), + zero_fill_field, + sizeof(*zero_fill_field)); auto name = FIXED_ONE_BYTE_STRING(env->isolate(), "zeroFill"); auto value = Uint32Array::New(array_buffer, 0, 1); CHECK(binding_object->Set(env->context(), name, value).FromJust());