Skip to content

Cap pack() array Length walk (same 1e6 policy as unpack) #10

Description

@enochgroot

Unpack rejects array/map n > 1e6. pack() does not.

PackArray snapshots Array::Length() and walks that many elements with no policy cap. pack(arr, { interpret }) re-reads Length() for the header and the loop, so a getter that grows length extends the walk. Depth is still 512; size is not.

Apply kMaxContainer (and freeze n for the interpret loop) before packing arrays/maps. Reject sparse huge Length() the same way ScanOne rejects huge headers.

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

    No labels
    No labels

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions