summaryrefslogtreecommitdiffstats
path: root/tests/auto/network/access/qdecompresshelper
diff options
context:
space:
mode:
authorMårten Nordheim <marten.nordheim@qt.io>2020-08-19 12:47:47 +0200
committerMårten Nordheim <marten.nordheim@qt.io>2020-09-22 19:08:53 +0200
commita07f35409bc1e129b027fc7ccb312949a454f66e (patch)
tree84cde42e8d76a0eb0abbaddf474975eb8393a57f /tests/auto/network/access/qdecompresshelper
parent16a1ddd73337c2622499c77b12de9395d43aba87 (diff)
QDecompressHelper: limit decompression ratio
To avoid potential decompression bombs. This is implemented with just a simple check that the ratio doesn't pass some hardcoded preset. Change-Id: I17246f0f43e73280cdb35a8f03d65885f5678ad6 Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
Diffstat (limited to 'tests/auto/network/access/qdecompresshelper')
-rw-r--r--tests/auto/network/access/qdecompresshelper/tst_qdecompresshelper.cpp2
1 files changed, 2 insertions, 0 deletions
diff --git a/tests/auto/network/access/qdecompresshelper/tst_qdecompresshelper.cpp b/tests/auto/network/access/qdecompresshelper/tst_qdecompresshelper.cpp
index 7a3aa37a47..23040b7624 100644
--- a/tests/auto/network/access/qdecompresshelper/tst_qdecompresshelper.cpp
+++ b/tests/auto/network/access/qdecompresshelper/tst_qdecompresshelper.cpp
@@ -372,6 +372,7 @@ void tst_QDecompressHelper::decompressBigData()
const qint64 third = file.bytesAvailable() / 3;
QDecompressHelper helper;
+ helper.setArchiveBombDetectionEnabled(false);
QFETCH(QByteArray, encoding);
helper.setEncoding(encoding);
@@ -401,6 +402,7 @@ void tst_QDecompressHelper::bigZlib()
QByteArray compressedData = file.readAll();
QDecompressHelper helper;
+ helper.setArchiveBombDetectionEnabled(false);
helper.setEncoding("deflate");
auto firstHalf = compressedData.left(compressedData.size() - 2);
helper.feed(firstHalf);