summarylogtreecommitdiffstats
path: root/0001-Fix-nullptr-dereference-with-invalid-SVG.patch
blob: 3b84eb4bf6911a9e2bc1e309f47eb24cb488ad15 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
From 50aaab95b65433a6a8ed616c6f473ca12389e3f0 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 2649422..335500a 100644
--- a/src/svg/qsvghandler.cpp
+++ b/src/svg/qsvghandler.cpp
@@ -3606,6 +3606,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.42.0