From 5e8005ed8de2d7955ede919402eb890c73f17673 Mon Sep 17 00:00:00 2001 From: Norman Maurer Date: Fri, 1 Dec 2023 10:45:12 +0100 Subject: [PATCH] QPACK: Handle it as an error if we receive an ack for a section for which we have no indices. Motivation: We should treat it as an error if we receive an ack for a section for which we have no indices. Modifications: Throw exception if we receive an ack for a section that has no indices Result: Correctly handle acks --- .../java/io/netty/incubator/codec/http3/QpackEncoder.java | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/src/main/java/io/netty/incubator/codec/http3/QpackEncoder.java b/src/main/java/io/netty/incubator/codec/http3/QpackEncoder.java index f3cc179..65df0d8 100644 --- a/src/main/java/io/netty/incubator/codec/http3/QpackEncoder.java +++ b/src/main/java/io/netty/incubator/codec/http3/QpackEncoder.java @@ -151,9 +151,12 @@ void sectionAcknowledgment(long streamId) throws QpackException { if (tracker.isEmpty()) { streamSectionTrackers.remove(streamId); } - if (dynamicTableIndices != null) { - dynamicTableIndices.forEach(dynamicTable::acknowledgeInsertCount); + + if (dynamicTableIndices == null) { + throw INVALID_SECTION_ACKNOWLEDGMENT; } + + dynamicTableIndices.forEach(dynamicTable::acknowledgeInsertCount); } /**