diff options
author | Mårten Nordheim <marten.nordheim@qt.io> | 2021-10-08 13:53:53 +0200 |
---|---|---|
committer | Mårten Nordheim <marten.nordheim@qt.io> | 2021-10-08 15:29:41 +0000 |
commit | f761ea71d10a0a0df85fa3abc1f810fe3bd59131 (patch) | |
tree | 5e6fcb46460c1221c9fa7c289308375bb72c308e /src | |
parent | 3316fb734df2068fad302087c18798085c0300fa (diff) |
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 <edward.welbourne@qt.io>
Reviewed-by: Timur Pocheptsov <timur.pocheptsov@qt.io>
Diffstat (limited to 'src')
-rw-r--r-- | src/network/access/qhttp2protocolhandler.cpp | 5 |
1 files changed, 5 insertions, 0 deletions
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 { |