Skip to content

QpackEncoder.sectionAcknowledgment must not NPE when dynamic table is disabled - #17537

Merged
normanmaurer merged 1 commit into
4.2from
qpack-npe-8531754e
Sep 20, 2026
Merged

normanmaurer merged 1 commit into
4.2from
qpack-npe-8531754e

Conversation

@normanmaurer

Copy link
Copy Markdown
Member

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.

… 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.
@normanmaurer normanmaurer added this to the 4.2.19.Final milestone Sep 18, 2026
@normanmaurer normanmaurer added the needs-cherry-pick-5.0 This PR should be cherry-picked to 5.0 once merged. label Sep 18, 2026
@testlens-app

testlens-app Bot commented Sep 18, 2026

Copy link
Copy Markdown

✅ All tests passed ✅

🏷️ Commit: ce89a36
▶️ Tests: 462692 executed
⚪️ Checks: 27/27 completed


Learn more about TestLens at testlens.app/docs.

@normanmaurer
normanmaurer merged commit 8ce5930 into 4.2 Sep 20, 2026
28 checks passed
@normanmaurer
normanmaurer deleted the qpack-npe-8531754e branch September 20, 2026 11:42
@netty-project-bot

Copy link
Copy Markdown
Contributor

Auto-port PR for 5.0: #17555

@github-actions github-actions Bot removed the needs-cherry-pick-5.0 This PR should be cherry-picked to 5.0 once merged. label Sep 20, 2026
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]>
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.

2 participants