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

Sign up
Appearance settings

Nan is enforcing wrong ~1GB kMaxLength for Nan::NewBuffer, should be 4GB #964

Open
@Rush

Description

This resulted in a real-world application issue:

[1] Assertion failed: (size <= imp::kMaxLength && "too large buffer"), function NewBuffer, file nan.h, line 939.

Buffers of 1GB are definitely realistic when dealing with >4k visual data.

The check is implemented here

nan/nan.h

Line 896 in e14bdcd

assert(length <= imp::kMaxLength && "too large buffer");

The constant is defined here:

nan/nan.h

Line 417 in e14bdcd

static const size_t kMaxLength = 0x3fffffff;

I believe it should be 4GB as reported by buffer.constants.MAX_LENGTH (https://nodejs.org/api/buffer.html#bufferkmaxlength)

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions

        AltStyle によって変換されたページ (->オリジナル) /