From dc26a57548370ac80709d7a022591d74f62f3242 Mon Sep 17 00:00:00 2001 From: Chris Smowton Date: Fri, 23 Jan 2026 15:03:33 +0000 Subject: [PATCH] Use posessive quantifier to avoid stack overflow on large ${{}} expressions --- actions/ql/lib/codeql/actions/ast/internal/Ast.qll | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/actions/ql/lib/codeql/actions/ast/internal/Ast.qll b/actions/ql/lib/codeql/actions/ast/internal/Ast.qll index b922214e21c..6c2adbf461f 100644 --- a/actions/ql/lib/codeql/actions/ast/internal/Ast.qll +++ b/actions/ql/lib/codeql/actions/ast/internal/Ast.qll @@ -27,8 +27,8 @@ string getADelimitedExpression(YamlString s, int offset) { // not just the last (greedy match) or first (reluctant match). result = s.getValue() - .regexpFind("\\$\\{\\{(?:[^}]|}(?!}))*\\}\\}", _, offset) - .regexpCapture("(\\$\\{\\{(?:[^}]|}(?!}))*\\}\\})", 1) + .regexpFind("\\$\\{\\{(?:[^}]|}(?!}))*+\\}\\}", _, offset) + .regexpCapture("(\\$\\{\\{(?:[^}]|}(?!}))*+\\}\\})", 1) .trim() }