summaryrefslogtreecommitdiff
path: root/src/svg/qsvghandler.cpp
diff options
context:
space:
mode:
authorEirik Aavitsland <eirik.aavitsland@qt.io>2017-11-14 14:47:08 +0100
committerEirik Aavitsland <eirik.aavitsland@qt.io>2017-11-15 07:30:00 +0000
commit18a2adad907523ea31251ff0b62e3321241a40fa (patch)
tree406882094df55cbcd0d224c9fdd110d1e5886978 /src/svg/qsvghandler.cpp
parentc4c9b60dc4bbe3c3837c80ea63682f3ef9403277 (diff)
downloadqtsvg-18a2adad907523ea31251ff0b62e3321241a40fa.tar.gz
Fix crash on recursive self-referral in <use> element
Referring to an ancestor in a <use> element would lead to endless recursion. Add checks to avoid recursion, and also emit a warning while parsing. Task-number: QTBUG-64425 Change-Id: I9ee1b9bfef13796cc3f387ff8579c6b13bc4ae9a Reviewed-by: Andy Shaw <andy.shaw@qt.io>
Diffstat (limited to 'src/svg/qsvghandler.cpp')
-rw-r--r--src/svg/qsvghandler.cpp2
1 files changed, 2 insertions, 0 deletions
diff --git a/src/svg/qsvghandler.cpp b/src/svg/qsvghandler.cpp
index 7841fa3..022afb6 100644
--- a/src/svg/qsvghandler.cpp
+++ b/src/svg/qsvghandler.cpp
@@ -3338,6 +3338,8 @@ static QSvgNode *createUseNode(QSvgNode *parent,
if (group) {
QSvgNode *link = group->scopeNode(linkId);
if (link) {
+ if (parent->isDescendantOf(link))
+ qCWarning(lcSvgHandler, "link #%s is recursive!", qPrintable(linkId));
QPointF pt;
if (!xStr.isNull() || !yStr.isNull()) {
QSvgHandler::LengthType type;