Skip to content

src: make buffers 2**32 index proof #31514

@bnoordhuis

Description

@bnoordhuis

Refs: #31399

Audit src/node_buffer.cc, lib/buffer.js and lib/internal/buffer.js - there are places where assumptions are made about the type of indices, e.g.:

node/src/node_buffer.cc

Lines 593 to 596 in 3ff2aec

uint32_t start;
if (!args[2]->Uint32Value(ctx).To(&start)) return;
uint32_t end;
if (!args[3]->Uint32Value(ctx).To(&end)) return;

I suspect most C++ code can be switched over to ParseArrayIndex().

Metadata

Metadata

Assignees

No one assigned

    Labels

    bufferIssues and PRs related to the buffer subsystem.lib / srcIssues and PRs related to general changes in the lib or src directory.

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions