Skip to content

PooledArrayBufferWriter accepts invalid advances and capacity overflow #760

Description

DISCLOSURE: LLM-GENERATED TEXT

Problem

PooledArrayBufferWriter.Advance accepts negative counts and counts beyond the granted buffer. This can move _written below zero or past the writable span. EnsureCapacity also treats a negative size hint as one, while unchecked addition and growth can overflow.

Acceptance criteria

  • Reject invalid Advance counts without changing writer state.
  • Reject negative size hints.
  • Guard total capacity calculations and growth against overflow.
  • Add boundary tests for negative, oversized, and overflow inputs.
  • Keep normal serialization, pooling, typechecks, and allocation checks green.

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

    Type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions