Skip to content

Cover frame header field boundaries and invalid sizes - #173

Open
ryanduguid wants to merge 1 commit into
python-hyper:masterfrom
ryanduguid:test-frame-header-boundaries
Open

ryanduguid wants to merge 1 commit into
python-hyper:masterfrom
ryanduguid:test-frame-header-boundaries

Conversation

@ryanduguid

Copy link
Copy Markdown

Summary

Add 35 frame-header cases covering 24-bit lengths, nonzero stream IDs with the reserved bit set, unknown-frame flags and error metadata, and buffers shorter or longer than nine bytes.

Evidence

  • The original suite passes 148 tests with 100% branch coverage. The candidate passes 183 tests with 100% branch coverage on Linux Python 3.10, 3.11, 3.12, 3.13 and 3.14, plus Windows Python 3.14.
  • Five controlled faults each pass all 148 original tests but fail the added cases: truncating high length bits, truncating high stream-ID bits, accepting oversized headers, reporting a truncated unknown-frame length, and dropping an unknown flag's high bit. The added tests reject these with six, two, two, two and two failures respectively on both platforms.
  • Source Ruff and strict mypy pass on both platforms. Configured Linux Sphinx, manifest, wheel/sdist and Twine checks pass. The test file is included in the sdist, and all runtime files match the base.

The fault injections and verification helpers are outside the PR.

Merge danger

Door: two-way. Blast radius: tests.

Only tests/test_frame_header.py is added.

Unverified

macOS, other Windows versions, Windows documentation/packaging, hosted CI, scanner parser coverage and maintainer acceptance. Packaging succeeds with warnings about unchanged license metadata and empty exclusion patterns.

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

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant