Blame SOURCES/qtsvg-fix-crash-when-parsing-malformed-url-reference.patch

80a0e2
diff --git a/src/svg/qsvghandler.cpp b/src/svg/qsvghandler.cpp
80a0e2
index 77af8161..7378e962 100644
80a0e2
--- a/src/svg/qsvghandler.cpp
80a0e2
+++ b/src/svg/qsvghandler.cpp
80a0e2
@@ -746,16 +746,17 @@ static QVector<qreal> parsePercentageList(const QChar *&str)
80a0e2
 static QString idFromUrl(const QString &url)
80a0e2
 {
80a0e2
     QString::const_iterator itr = url.constBegin();
80a0e2
-    while ((*itr).isSpace())
80a0e2
+    QString::const_iterator end = url.constEnd();
80a0e2
+    while (itr != end && (*itr).isSpace())
80a0e2
         ++itr;
80a0e2
-    if ((*itr) == QLatin1Char('('))
80a0e2
+    if (itr != end && (*itr) == QLatin1Char('('))
80a0e2
         ++itr;
80a0e2
-    while ((*itr).isSpace())
80a0e2
+    while (itr != end && (*itr).isSpace())
80a0e2
         ++itr;
80a0e2
-    if ((*itr) == QLatin1Char('#'))
80a0e2
+    if (itr != end && (*itr) == QLatin1Char('#'))
80a0e2
         ++itr;
80a0e2
     QString id;
80a0e2
-    while ((*itr) != QLatin1Char(')')) {
80a0e2
+    while (itr != end && (*itr) != QLatin1Char(')')) {
80a0e2
         id += *itr;
80a0e2
         ++itr;
80a0e2
     }