summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRobert Loehning <robert.loehning@qt.io>2020-08-25 16:06:02 +0200
committerQt Cherry-pick Bot <cherrypick_bot@qt-project.org>2020-08-26 04:34:30 +0000
commitcd30c2e9170e4016b29ca0682d733735c8c25bb7 (patch)
tree88fa12b5432beae95d5eb26676ba1726e4198c61
parentba2477be62b03bb97af13e8c1d51ac6fb5010095 (diff)
downloadqtsvg-cd30c2e9170e4016b29ca0682d733735c8c25bb7.tar.gz
Don't return partially inflated QByteArray
We're already stopping the extraction because we're running out of memory. It's no use to return this provisional result. Task-number: oss-fuzz-24611 Change-Id: Iea5a65a0f30b7a03c5405017c21cd9495a7c2971 Reviewed-by: Thiago Macieira <thiago.macieira@intel.com> (cherry picked from commit 103aace3b30ede9e5f5621e14542f5369eac749d) Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
-rw-r--r--src/svg/qsvgtinydocument.cpp2
1 files changed, 1 insertions, 1 deletions
diff --git a/src/svg/qsvgtinydocument.cpp b/src/svg/qsvgtinydocument.cpp
index dd2c1ab..8e12d5c 100644
--- a/src/svg/qsvgtinydocument.cpp
+++ b/src/svg/qsvgtinydocument.cpp
@@ -130,7 +130,7 @@ QByteArray qt_inflateGZipDataFrom(QIODevice *device)
if (oldSize > INT_MAX - CHUNK_SIZE) {
inflateEnd(&zlibStream);
qCWarning(lcSvgHandler, "Error while inflating gzip file: integer size overflow");
- return destination;
+ return QByteArray();
}
destination.resize(oldSize + CHUNK_SIZE);