File 0014-Don-t-return-partially-inflated-QByteArray.patch of Package libqt5-qtsvg.29651

From 2d433eb0a64d7a8d3b0947cf4947389509c4839d Mon Sep 17 00:00:00 2001
From: Robert Loehning <robert.loehning@qt.io>
Date: Tue, 25 Aug 2020 16:06:02 +0200
Subject: [PATCH 14/21] 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>
(cherry picked from commit b0a33d20a5d775d517b8c55f3e9b03d614033d6f)
---
 src/svg/qsvgtinydocument.cpp | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/src/svg/qsvgtinydocument.cpp b/src/svg/qsvgtinydocument.cpp
index ba0eca5..a202a25 100644
--- a/src/svg/qsvgtinydocument.cpp
+++ b/src/svg/qsvgtinydocument.cpp
@@ -128,7 +128,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);
-- 
2.20.1

openSUSE Build Service is sponsored by