From 33d84718e50d7e6a8caa5d64bf02e4e469baf96b Mon Sep 17 00:00:00 2001 From: Guldoman Date: Mon, 22 Jul 2024 21:08:25 +0200 Subject: [PATCH] fix: avoid possible ReDoS in `language_groovy` --- manifest.json | 2 +- plugins/language_groovy.lua | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/manifest.json b/manifest.json index e6d7422a..4d6fb4b0 100644 --- a/manifest.json +++ b/manifest.json @@ -1058,7 +1058,7 @@ "tags": [ "language" ], - "version": "0.2" + "version": "0.2.1" }, { "description": "Syntax for the [Hare](https://harelang.org) programming language", diff --git a/plugins/language_groovy.lua b/plugins/language_groovy.lua index 2886e106..de597718 100644 --- a/plugins/language_groovy.lua +++ b/plugins/language_groovy.lua @@ -23,7 +23,7 @@ syntax.add { { pattern = "[%+%-=/%*%^%%<>!~|&]", type = "operator" }, -- Operators { pattern = "[%a_][%w_]*%f[(]", type = "function" }, -- Function/Class/Method/... { pattern = "[%a_][%w_]*%f[%[]", type = "function" }, -- Custom Type - { regex = "[A-Z]+_?[A-Z]+", type = "keyword2" }, -- Constants + { regex = "[A-Z]+|[A-Z]+_[A-Z]+", type = "keyword2" }, -- Constants { pattern = "import()%s+()[%w_.]+", type = { "keyword", "normal", "normal" } }, { pattern = "[%a_][%w_]*", type = "symbol" }, -- ? { pattern = "[a-zA-Z]+%.+", type = "function" }, -- Lib path