Repository navigation
QpackEncoder.sectionAcknowledgment must not NPE when dynamic table is disabled - #17537
Merged
Merged
Conversation
… disabled Motivation: QpackEncoder.sectionAcknowledgment(...) only had an assert to guard against streamSectionTrackers being null, which is a no-op unless the JVM runs with -ea. When a peer negotiates SETTINGS_QPACK_MAX_TABLE_CAPACITY=0 (the RFC 9204 default), configureDynamicTable(...) never allocates streamSectionTrackers. A peer can then send a single Section Acknowledgment instruction (0x80) on its QPACK decoder stream and trigger a NullPointerException, which escapes the QpackException catch in QpackDecoderHandler and tears down the connection. Modification: Replace the assert with an explicit null check that throws the existing INVALID_SECTION_ACKNOWLEDGMENT QpackException, matching the pattern already used by the sibling streamCancellation(...) method. Result: A Section Acknowledgment received while the dynamic table is disabled is now reported as a QpackException instead of crashing the connection with an unchecked NullPointerException.
✅ All tests passed ✅🏷️ Commit: ce89a36 Learn more about TestLens at testlens.app/docs. |
Contributor
|
Auto-port PR for 5.0: #17555 |
normanmaurer
added a commit
that referenced
this pull request
Sep 20, 2026
…ynamic table is disabled (#17555) Auto-port of #17537 to 5.0 Cherry-picked commit: 8ce5930 --- Motivation: QpackEncoder.sectionAcknowledgment(...) only had an assert to guard against streamSectionTrackers being null, which is a no-op unless the JVM runs with -ea. When a peer negotiates SETTINGS_QPACK_MAX_TABLE_CAPACITY=0 (the RFC 9204 default), configureDynamicTable(...) never allocates streamSectionTrackers. A peer can then send a single Section Acknowledgment instruction (0x80) on its QPACK decoder stream and trigger a NullPointerException, which escapes the QpackException catch in QpackDecoderHandler and tears down the connection. Modification: Replace the assert with an explicit null check that throws the existing INVALID_SECTION_ACKNOWLEDGMENT QpackException, matching the pattern already used by the sibling streamCancellation(...) method. Result: A Section Acknowledgment received while the dynamic table is disabled is now reported as a QpackException instead of crashing the connection with an unchecked NullPointerException. Co-authored-by: Norman Maurer <[email protected]>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Motivation:
QpackEncoder.sectionAcknowledgment(...) only had an assert to guard
against streamSectionTrackers being null, which is a no-op unless the
JVM runs with -ea. When a peer negotiates
SETTINGS_QPACK_MAX_TABLE_CAPACITY=0 (the RFC 9204 default),
configureDynamicTable(...) never allocates streamSectionTrackers. A
peer can then send a single Section Acknowledgment instruction
(0x80) on its QPACK decoder stream and trigger a
NullPointerException, which escapes the QpackException catch in
QpackDecoderHandler and tears down the connection.
Modification:
Replace the assert with an explicit null check that throws the
existing INVALID_SECTION_ACKNOWLEDGMENT QpackException, matching the
pattern already used by the sibling streamCancellation(...) method.
Result:
A Section Acknowledgment received while the dynamic table is disabled
is now reported as a QpackException instead of crashing the
connection with an unchecked NullPointerException.