Skip to content

fix(protocols): an empty raw option raises IndexError in the IPv4, HOPOPT and IPv6_Opts makers #2723

Closed

Description

@JarryShaw

Found while fixing #2708. #2708 makes a raw b'' TCP option raise ProtocolError, but the same input still fails as a bare IndexError in other makers on main at 982b542fc.

  • IPv4(options=[b''])
  • HOPOPT(options=[b''])
  • IPv6_Opts(options=[b''])

Each raw-bytes option branch reads schema[0] before it checks the length. A malformed caller value should raise ProtocolError, as the other malformed items in those branches do. Sweep every maker with a raw-bytes option or parameter branch for the same gap.

Activity

  1. added this to the PyPCAPKit v1.6 milestone on Nov 3, 2026
  2. added
    bugIssues reporting a defect (set by the bug report template; a default, not an assessment)
    wipWork in flight - a covering PR is open or an agent is actively on it
    on Nov 3, 2026
  3. JarryShaw commented on Nov 3, 2026

    @JarryShaw
    OwnerAuthor

    The PR is #2728.

  4. removed
    wipWork in flight - a covering PR is open or an agent is actively on it
    on Nov 3, 2026
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

    bugIssues reporting a defect (set by the bug report template; a default, not an assessment)

    Projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions