summaryrefslogtreecommitdiff
blob: 840baa810520d6282de6c4e46c5d25b495b5175f (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
Fix inifite loop 

https://bugs.gentoo.org/show_bug.cgi?id=474716
https://bugzilla.gnome.org/show_bug.cgi?id=701295

Patch written by Dimitri van Heesch <dimitri@stack.nl>

--- a/src/util.cpp
+++ b/src/util.cpp
@@ -1843,11 +1843,15 @@ int findParameterList(const QString &name)
         ++templateDepth;
         pos=nextOpenPos-1;
       }
-      else
+      else if (nextClosePos!=-1)
       {
         --templateDepth;
         pos=nextClosePos-1;
       }
+      else // more >'s than <'s, see bug701295
+      {
+        return -1;
+      }
     }
     else
     {