Skip to content

Commit dc26a57

Browse files
committed
Use posessive quantifier to avoid stack overflow on large ${{}} expressions
1 parent 075041f commit dc26a57

File tree

1 file changed

+2
-2
lines changed
  • actions/ql/lib/codeql/actions/ast/internal

1 file changed

+2
-2
lines changed

actions/ql/lib/codeql/actions/ast/internal/Ast.qll

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -27,8 +27,8 @@ string getADelimitedExpression(YamlString s, int offset) {
2727
// not just the last (greedy match) or first (reluctant match).
2828
result =
2929
s.getValue()
30-
.regexpFind("\\$\\{\\{(?:[^}]|}(?!}))*\\}\\}", _, offset)
31-
.regexpCapture("(\\$\\{\\{(?:[^}]|}(?!}))*\\}\\})", 1)
30+
.regexpFind("\\$\\{\\{(?:[^}]|}(?!}))*+\\}\\}", _, offset)
31+
.regexpCapture("(\\$\\{\\{(?:[^}]|}(?!}))*+\\}\\})", 1)
3232
.trim()
3333
}
3434

0 commit comments

Comments
 (0)