[gtksourceview] Revert "contextengine: disable highlighting in presence of long lines"



commit 388a08a42a9ead972f33adc401672d1c1da0f7fa
Author: Christian Hergert <chergert redhat com>
Date:   Fri Apr 19 14:04:48 2019 -0700

    Revert "contextengine: disable highlighting in presence of long lines"
    
    This reverts commit 7aa2913887d52dddfb06acf2937611f51671d7f1.

 gtksourceview/gtksourcecontextengine.c | 16 ----------------
 1 file changed, 16 deletions(-)
---
diff --git a/gtksourceview/gtksourcecontextengine.c b/gtksourceview/gtksourcecontextengine.c
index 70267065..9b34c72f 100644
--- a/gtksourceview/gtksourcecontextengine.c
+++ b/gtksourceview/gtksourcecontextengine.c
@@ -86,12 +86,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)
@@ -4216,16 +4210,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]