Accepting request 1118069 from KDE:Qt6
- Add patches (boo#1216269, QTBUG-117944): * 0001-fix-nullptr-derefence-with-invalid-SVG.patch * 0002-make-sure-we-do-not-load-invalid-SVGs-twice.patch OBS-URL: https://build.opensuse.org/request/show/1118069 OBS-URL: https://build.opensuse.org/package/show/openSUSE:Factory/qt6-svg?expand=0&rev=27
This commit is contained in:
commit
6ba4f319f8
29
0001-fix-nullptr-derefence-with-invalid-SVG.patch
Normal file
29
0001-fix-nullptr-derefence-with-invalid-SVG.patch
Normal file
@ -0,0 +1,29 @@
|
|||||||
|
From edc8ca7f1e45302223b4b7962a57a30918f84c8d Mon Sep 17 00:00:00 2001
|
||||||
|
From: Paul Olav Tvete <paul.tvete@qt.io>
|
||||||
|
Date: Tue, 10 Oct 2023 10:14:22 +0200
|
||||||
|
Subject: [PATCH] Fix nullptr dereference with invalid SVG
|
||||||
|
|
||||||
|
Fixes: QTBUG-117944
|
||||||
|
Pick-to: 6.6 6.5 6.2
|
||||||
|
Change-Id: I9059dc28c750fc0585f1fb982152b211c323c6cd
|
||||||
|
Reviewed-by: Eskil Abrahamsen Blomfeldt <eskil.abrahamsen-blomfeldt@qt.io>
|
||||||
|
---
|
||||||
|
src/svg/qsvghandler.cpp | 2 ++
|
||||||
|
1 file changed, 2 insertions(+)
|
||||||
|
|
||||||
|
diff --git a/src/svg/qsvghandler.cpp b/src/svg/qsvghandler.cpp
|
||||||
|
index e6877acc..1cffbc37 100644
|
||||||
|
--- a/src/svg/qsvghandler.cpp
|
||||||
|
+++ b/src/svg/qsvghandler.cpp
|
||||||
|
@@ -3620,6 +3620,8 @@ void QSvgHandler::init()
|
||||||
|
|
||||||
|
static bool detectCycles(const QSvgNode *node, QList<const QSvgUse *> active = {})
|
||||||
|
{
|
||||||
|
+ if (Q_UNLIKELY(!node))
|
||||||
|
+ return false;
|
||||||
|
switch (node->type()) {
|
||||||
|
case QSvgNode::DOC:
|
||||||
|
case QSvgNode::G:
|
||||||
|
--
|
||||||
|
2.16.3
|
||||||
|
|
79
0002-make-sure-we-do-not-load-invalid-SVGs-twice.patch
Normal file
79
0002-make-sure-we-do-not-load-invalid-SVGs-twice.patch
Normal file
@ -0,0 +1,79 @@
|
|||||||
|
From a090bd1f9a7bfa14f06b14570c6a5a37843931c6 Mon Sep 17 00:00:00 2001
|
||||||
|
From: Paul Olav Tvete <paul.tvete@qt.io>
|
||||||
|
Date: Tue, 10 Oct 2023 11:41:41 +0200
|
||||||
|
Subject: [PATCH] Make sure we don't load invalid SVGs twice
|
||||||
|
|
||||||
|
Fixes a bug where loading an invalid SVG that happens
|
||||||
|
to be valid XML could behave differently in QML and C++,
|
||||||
|
because readimage() in qquickpixmapcache.cpp calls
|
||||||
|
QImageReader::size() twice.
|
||||||
|
|
||||||
|
Task-number: QTBUG-117944
|
||||||
|
Pick-to: 6.6 6.5
|
||||||
|
Change-Id: Ibef7f54627c76414c66f81804f5f46f2db3594ba
|
||||||
|
Reviewed-by: Eirik Aavitsland <eirik.aavitsland@qt.io>
|
||||||
|
Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
|
||||||
|
---
|
||||||
|
src/plugins/imageformats/svg/qsvgiohandler.cpp | 16 +++++++++-------
|
||||||
|
1 file changed, 9 insertions(+), 7 deletions(-)
|
||||||
|
|
||||||
|
diff --git a/src/plugins/imageformats/svg/qsvgiohandler.cpp b/src/plugins/imageformats/svg/qsvgiohandler.cpp
|
||||||
|
index b04ee6b2..570c9829 100644
|
||||||
|
--- a/src/plugins/imageformats/svg/qsvgiohandler.cpp
|
||||||
|
+++ b/src/plugins/imageformats/svg/qsvgiohandler.cpp
|
||||||
|
@@ -19,7 +19,7 @@ class QSvgIOHandlerPrivate
|
||||||
|
{
|
||||||
|
public:
|
||||||
|
QSvgIOHandlerPrivate(QSvgIOHandler *qq)
|
||||||
|
- : q(qq), loaded(false), readDone(false), backColor(Qt::transparent)
|
||||||
|
+ : q(qq), loadAttempted(false), loadStatus(false), readDone(false), backColor(Qt::transparent)
|
||||||
|
{}
|
||||||
|
|
||||||
|
bool load(QIODevice *device);
|
||||||
|
@@ -31,7 +31,8 @@ public:
|
||||||
|
QRect clipRect;
|
||||||
|
QSize scaledSize;
|
||||||
|
QRect scaledClipRect;
|
||||||
|
- bool loaded;
|
||||||
|
+ bool loadAttempted;
|
||||||
|
+ bool loadStatus;
|
||||||
|
bool readDone;
|
||||||
|
QColor backColor;
|
||||||
|
};
|
||||||
|
@@ -39,8 +40,9 @@ public:
|
||||||
|
|
||||||
|
bool QSvgIOHandlerPrivate::load(QIODevice *device)
|
||||||
|
{
|
||||||
|
- if (loaded)
|
||||||
|
- return true;
|
||||||
|
+ if (loadAttempted)
|
||||||
|
+ return loadStatus;
|
||||||
|
+ loadAttempted = true;
|
||||||
|
if (q->format().isEmpty())
|
||||||
|
q->canRead();
|
||||||
|
|
||||||
|
@@ -63,10 +65,10 @@ bool QSvgIOHandlerPrivate::load(QIODevice *device)
|
||||||
|
|
||||||
|
if (res) {
|
||||||
|
defaultSize = r.defaultSize();
|
||||||
|
- loaded = true;
|
||||||
|
+ loadStatus = true;
|
||||||
|
}
|
||||||
|
|
||||||
|
- return loaded;
|
||||||
|
+ return loadStatus;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
@@ -105,7 +107,7 @@ bool QSvgIOHandler::canRead() const
|
||||||
|
{
|
||||||
|
if (!device())
|
||||||
|
return false;
|
||||||
|
- if (d->loaded && !d->readDone)
|
||||||
|
+ if (d->loadStatus && !d->readDone)
|
||||||
|
return true; // Will happen if we have been asked for the size
|
||||||
|
|
||||||
|
bool isCompressed = false;
|
||||||
|
--
|
||||||
|
2.16.3
|
||||||
|
|
@ -1,3 +1,10 @@
|
|||||||
|
-------------------------------------------------------------------
|
||||||
|
Mon Oct 16 14:40:42 UTC 2023 - Manfred Hollstein <manfred.h@gmx.net>
|
||||||
|
|
||||||
|
- Add patches (boo#1216269, QTBUG-117944):
|
||||||
|
* 0001-fix-nullptr-derefence-with-invalid-SVG.patch
|
||||||
|
* 0002-make-sure-we-do-not-load-invalid-SVGs-twice.patch
|
||||||
|
|
||||||
-------------------------------------------------------------------
|
-------------------------------------------------------------------
|
||||||
Tue Oct 10 09:40:01 UTC 2023 - Christophe Marin <christophe@krop.fr>
|
Tue Oct 10 09:40:01 UTC 2023 - Christophe Marin <christophe@krop.fr>
|
||||||
|
|
||||||
|
@ -33,6 +33,10 @@ Summary: Classes for rendering and displaying SVG drawings
|
|||||||
License: LGPL-3.0-only OR (GPL-2.0-only OR GPL-3.0-or-later)
|
License: LGPL-3.0-only OR (GPL-2.0-only OR GPL-3.0-or-later)
|
||||||
URL: https://www.qt.io
|
URL: https://www.qt.io
|
||||||
Source: https://download.qt.io/official_releases/qt/%{short_version}/%{real_version}%{tar_suffix}/submodules/%{tar_name}-%{real_version}%{tar_suffix}.tar.xz
|
Source: https://download.qt.io/official_releases/qt/%{short_version}/%{real_version}%{tar_suffix}/submodules/%{tar_name}-%{real_version}%{tar_suffix}.tar.xz
|
||||||
|
# PATCH-FIX-UPSTREAM 0001-fix-nullptr-derefence-with-invalid-SVG.patch QTBUG-117944 boo#1216269
|
||||||
|
Patch01: 0001-fix-nullptr-derefence-with-invalid-SVG.patch
|
||||||
|
# PATCH-FIX-UPSTREAM 0002-make-sure-we-do-not-load-invalid-SVGs-twice.patch boo#1216269
|
||||||
|
Patch02: 0002-make-sure-we-do-not-load-invalid-SVGs-twice.patch
|
||||||
Source99: qt6-svg-rpmlintrc
|
Source99: qt6-svg-rpmlintrc
|
||||||
BuildRequires: pkgconfig
|
BuildRequires: pkgconfig
|
||||||
BuildRequires: qt6-core-private-devel
|
BuildRequires: qt6-core-private-devel
|
||||||
|
Loading…
x
Reference in New Issue
Block a user