We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 7e9d73b commit 712c3ccCopy full SHA for 712c3cc
1 file changed
swift/ql/test/library-tests/regex/redos_variants.swift
@@ -46,5 +46,9 @@ func myRegexpVariantsTests(myUrl: URL) throws {
46
_ = try Regex("(a|aa?)b").firstMatch(in: tainted) // $ regex="call to Regex<AnyRegexOutput>.init(_:)" input=tainted
47
_ = try Regex("(a|aa?)*b").firstMatch(in: tainted) // $ regex="call to Regex<AnyRegexOutput>.init(_:)" input=tainted redos-vulnerable=
48
49
+ // from the qhelp:
50
+ _ = try Regex("^_(__|.)+_$").firstMatch(in: tainted) // $ regex="call to Regex<AnyRegexOutput>.init(_:)" input=tainted redos-vulnerable=
51
+ _ = try Regex("^_(__|[^_])+_$").firstMatch(in: tainted) // $ regex="call to Regex<AnyRegexOutput>.init(_:)" input=tainted
52
+
53
// TODO: test more variant expressions.
54
}
0 commit comments