summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorMatthias Rauter <matthias.rauter@qt.io>2023-11-24 09:08:15 +0100
committerMatthias Rauter <matthias.rauter@qt.io>2023-11-24 12:19:29 +0100
commit55e317db51143fe3f9265e5adeaa91aec002b75c (patch)
tree18a18e4ca1f3a06c74f7384f89c168cf3aa1819a /src
parent5cca42eb8164420d304267b1262660c713e876e8 (diff)
Fix a use after free introduced by a previous patch
Commit 5720e424698f65e6c7d76dafb9b7e45b3f5bb771 introduced a bug where a deleted svg node was accessed. This patch fixes the issue. Change-Id: Iab225bc158130586199289b0cf69832fa25a222c Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
Diffstat (limited to 'src')
-rw-r--r--src/svg/qsvghandler.cpp9
1 files changed, 6 insertions, 3 deletions
diff --git a/src/svg/qsvghandler.cpp b/src/svg/qsvghandler.cpp
index f2b3b08..796a38c 100644
--- a/src/svg/qsvghandler.cpp
+++ b/src/svg/qsvghandler.cpp
@@ -4161,11 +4161,14 @@ bool QSvgHandler::startElement(const QString &localName,
break;
}
}
- parseCoreNode(node, attributes);
+
+ if (node) {
+ parseCoreNode(node, attributes);
#ifndef QT_NO_CSSPARSER
- cssStyleLookup(node, this, m_selector);
+ cssStyleLookup(node, this, m_selector);
#endif
- parseStyle(node, attributes, this);
+ parseStyle(node, attributes, this);
+ }
}
} else if (FactoryMethod method = findGraphicsFactory(localName, featureSet())) {
//rendering element