From cd307451ae6f7f2800ef0cfd057c77babb882de8 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?M=C3=A5rten=20Nordheim?= Date: Fri, 16 Feb 2024 13:15:11 +0100 Subject: [PATCH] QHttp2Connection: fix potential streamId reuse MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Change-Id: Ib81058c4613820f15f55388b87433875c11492dd Reviewed-by: Øystein Heskestad Reviewed-by: Timur Pocheptsov (cherry picked from commit df4322f7f7dc818c5dd1dd859ce5010116d5d651) Reviewed-by: Qt Cherry-pick Bot --- src/network/access/qhttp2connection.cpp | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/network/access/qhttp2connection.cpp b/src/network/access/qhttp2connection.cpp index d2ac5f02908..349968d8d1d 100644 --- a/src/network/access/qhttp2connection.cpp +++ b/src/network/access/qhttp2connection.cpp @@ -559,8 +559,9 @@ QHttp2Connection::createStreamInternal() QHttp2Stream *QHttp2Connection::createStreamInternal_impl(quint32 streamID) { + qsizetype numStreams = m_streams.size(); QPointer &stream = m_streams[streamID]; - if (stream) + if (numStreams == m_streams.size()) // stream already existed return nullptr; stream = new QHttp2Stream(this, streamID); stream->m_recvWindow = streamInitialReceiveWindowSize;