Skip to content

Preserve unsigned Size1/Size2 and typed option integer boundaries compatibly #34

Closed

Description

@maikebing

Static source audit found an existing API boundary outside inbound option validation: Size1/Size2 are Int32? getters backed by Option.IntValue, while RFC7252/RFC7959 permit 0..0xffffffff. The upper half of that valid range is represented as a negative signed value. Raw typed Int32 conversion also shifts overlong values rather than reporting a range error; #28 rejects illegal wire lengths but raw codec access is a different contract. Design an extend-only unsigned or wider getter surface, preserve source/binary compatibility deliberately, and define old signed-access overflow behavior. Add round trips for 0, int.MaxValue, 0x80000000, uint.MaxValue, absent values, and invalid overlong fields. Test storage/hosting paths that consume these values, not just RawValue. Current finding is source evidence; new runtime regression is NOT_RUN.

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

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions