QHttp2Connection: Send error for CONTINUATION without preceding data

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
Pick-to: 6.7
Change-Id: Ib14e4610692dc4832b1f3e99dca497d9baf3d9d3
Reviewed-by: Mårten Nordheim <marten.nordheim@qt.io>
bb10
Øystein Heskestad 2024-03-15 16:13:56 +01:00
parent 9377039fe5
commit 89467428f8
1 changed files with 3 additions and 1 deletions

View File

@ -1551,7 +1551,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");