Skip to content

Commit ef344c6

Browse files
committed
Swift: Match flag groups more strictly as other (? group types exist.
1 parent 952a5d2 commit ef344c6

File tree

1 file changed

+1
-0
lines changed

1 file changed

+1
-0
lines changed

swift/ql/lib/codeql/swift/regex/internal/ParseRegex.qll

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -283,6 +283,7 @@ abstract class RegExp extends Expr {
283283
private predicate flagGroupStart(int start, int end) {
284284
this.isGroupStart(start) and
285285
this.getChar(start + 1) = "?" and
286+
this.getChar(start + 2) in ["i", "x", "s", "m", "w"] and
286287
end = start + 2
287288
}
288289

0 commit comments

Comments
 (0)