Skip to content

Guard HTTP/2 frame sequence lookahead#364

Merged
bneradt merged 1 commit intoyahoo:masterfrom
bneradt:h2_frame_lookahead
Mar 17, 2026
Merged

Guard HTTP/2 frame sequence lookahead#364
bneradt merged 1 commit intoyahoo:masterfrom
bneradt:h2_frame_lookahead

Conversation

@bneradt
Copy link
Copy Markdown
Collaborator

@bneradt bneradt commented Mar 17, 2026

H2Session::write() pops the current frame from the stream frame sequence and then immediately looks at the next entry to decide which flags to set. When the current frame is the last queued frame, that unconditional front() call reads past the end of the deque and aborts proxy-verifier with a std::deque::front() assertion.

Treat an empty post-pop frame sequence as having no next frame by using H2Frame::INVALID for the lookahead value. That preserves the existing flag selection logic while avoiding the invalid deque access on the final frame.

I confirm that this contribution is made under the terms of the license found in the root directory of this repository's source tree and that I have the authority necessary to make this contribution on behalf of its copyright owner.

H2Session::write() pops the current frame from the stream frame
sequence and then immediately looks at the next entry to decide
which flags to set. When the current frame is the last queued
frame, that unconditional front() call reads past the end of the
deque and aborts proxy-verifier with a std::deque::front()
assertion.

Treat an empty post-pop frame sequence as having no next frame by
using H2Frame::INVALID for the lookahead value. That preserves the
existing flag selection logic while avoiding the invalid deque
access on the final frame.
@bneradt bneradt self-assigned this Mar 17, 2026
@bneradt bneradt merged commit 084040d into yahoo:master Mar 17, 2026
@bneradt bneradt deleted the h2_frame_lookahead branch March 17, 2026 23:57
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