[gtksourceview/gnome-3-24] Revert "contextengine: disable highlighting in presence of long lines"



commit 8ce925cd21ff4dfaccf8583b24d9b22082cb39ee
Author: Christian Hergert <chergert redhat com>
Date:   Fri Apr 19 14:27:20 2019 -0700

    Revert "contextengine: disable highlighting in presence of long lines"
    
    This reverts commit 380d8d0b9a04d2811dd78764a74d1c1bdcba74fb.

 gtksourceview/gtksourcecontextengine.c | 16 ----------------
 1 file changed, 16 deletions(-)
---
diff --git a/gtksourceview/gtksourcecontextengine.c b/gtksourceview/gtksourcecontextengine.c
index 6c549b2b..f74ec78e 100644
--- a/gtksourceview/gtksourcecontextengine.c
+++ b/gtksourceview/gtksourcecontextengine.c
@@ -87,12 +87,6 @@
  */
 #define MAX_TIME_FOR_ONE_LINE          2000
 
-/* Maximum number of characters supported in one line or else highlighting
- * is dsiabled. This helps mitigate chances that libpcre can cause us to
- * overflow from poorly crafted regexes.
- */
-#define LINE_MAX_SUPPORTED_CHARS       2000
-
 #define GTK_SOURCE_CONTEXT_ENGINE_ERROR (gtk_source_context_engine_error_quark ())
 
 #define HAS_OPTION(def,opt) (((def)->flags & GTK_SOURCE_CONTEXT_##opt) != 0)
@@ -4208,16 +4202,6 @@ next_segment (GtkSourceContextEngine  *ce,
        g_assert (!ce->priv->hint2 || ce->priv->hint2->parent == state);
        g_assert (pos <= line->byte_length);
 
-       /* Bail on pathologically long lines to protect against possible
-        * recursion in regexes, as libpcre can stack-overflow. Also help to
-        * keep things fast in the presence of such difficult input.
-        */
-       if (line->char_length > LINE_MAX_SUPPORTED_CHARS)
-       {
-               ce->priv->disabled = TRUE;
-               return FALSE;
-       }
-
        while (pos <= line->byte_length)
        {
                DefinitionsIter def_iter;


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]