From f761ea71d10a0a0df85fa3abc1f810fe3bd59131 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?M=C3=A5rten=20Nordheim?= Date: Fri, 8 Oct 2021 13:53:53 +0200 Subject: Http2: Handle failed read from QDecompressHelper If the data is corrupt or the underlying library fails to read, the decompressHelper gets reset and we must not try to call it again. Emit an error since we cannot work with the data. Task-number: QTBUG-97179 Change-Id: I62c49fb2fbb2cd942c82a08937f817b6c762c883 Reviewed-by: Edward Welbourne Reviewed-by: Timur Pocheptsov --- src/network/access/qhttp2protocolhandler.cpp | 5 +++++ 1 file changed, 5 insertions(+) (limited to 'src') diff --git a/src/network/access/qhttp2protocolhandler.cpp b/src/network/access/qhttp2protocolhandler.cpp index 076570d474..efb5bcc74b 100644 --- a/src/network/access/qhttp2protocolhandler.cpp +++ b/src/network/access/qhttp2protocolhandler.cpp @@ -1288,6 +1288,11 @@ void QHttp2ProtocolHandler::updateStream(Stream &stream, const Frame &frame, if (read > 0) { output.resize(read); replyPrivate->responseData.append(std::move(output)); + } else if (read < 0) { + finishStreamWithError( + stream, QNetworkReply::ProtocolFailure, + QCoreApplication::translate("QHttp", "Data corrupted")); + return; } } } else { -- cgit v1.2.3