From fbdcae954ec8c511914ad3fd6b3d2a9d4ccb1f28 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=C3=98ystein=20Heskestad?= Date: Fri, 15 Mar 2024 16:13:56 +0100 Subject: [PATCH] QHttp2Connection: Send error for CONTINUATION without preceding data MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Send connection error type PROTOCOL_ERROR when receivng CONTINUATION frames without any data received from previous HEADERS or PUSH_PROMISE frames, instead of assert. Task-number: QTBUG-122375 Change-Id: Ib14e4610692dc4832b1f3e99dca497d9baf3d9d3 Reviewed-by: MÃ¥rten Nordheim (cherry picked from commit 89467428f8173524083fd7d2cca9c2985141d567) Reviewed-by: Qt Cherry-pick Bot --- src/network/access/qhttp2connection.cpp | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/network/access/qhttp2connection.cpp b/src/network/access/qhttp2connection.cpp index 32190d2dee7..d572d4ac7bb 100644 --- a/src/network/access/qhttp2connection.cpp +++ b/src/network/access/qhttp2connection.cpp @@ -1204,7 +1204,9 @@ void QHttp2Connection::handleWINDOW_UPDATE() void QHttp2Connection::handleCONTINUATION() { Q_ASSERT(inboundFrame.type() == FrameType::CONTINUATION); - Q_ASSERT(!continuedFrames.empty()); // HEADERS frame must be already in. + if (continuedFrames.empty()) + return connectionError(PROTOCOL_ERROR, + "CONTINUATION without a preceding HEADERS or PUSH_PROMISE"); if (inboundFrame.streamID() != continuedFrames.front().streamID()) return connectionError(PROTOCOL_ERROR, "CONTINUATION on invalid stream");