Skip to content

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

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().

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

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

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions