]> granicus.if.org Git - apache/commitdiff
Prevent infinite looping in case of borked spans or code.
authorDaniel Gruno <humbedooh@apache.org>
Thu, 26 Apr 2012 17:49:39 +0000 (17:49 +0000)
committerDaniel Gruno <humbedooh@apache.org>
Thu, 26 Apr 2012 17:49:39 +0000 (17:49 +0000)
git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1330992 13f79535-47bb-0310-9956-ffa450edef68

docs/manual/style/scripts/prettify.js

index bf2cbdb9f0b50865361625a7422626c6d4d4c094..1a61d9cfb673c7dee88e47b1281e29528c7a3f57 100644 (file)
@@ -1135,7 +1135,10 @@ var REGEXP_PRECEDER_PATTERN = '(?:^^\\.?|[+-]|[!=]=?=?|\\#|%=?|&&?=?|\\(|\\*=?|[
     }
     try {
       var decoration = null;
+      var X = 0;
       while (spanIndex < nSpans) {
+        X = X + 1;
+        if (X > 1000) { break; }
         var spanStart = spans[spanIndex];
         var spanEnd = spans[spanIndex + 2] || sourceLength;