Skip to content

Commit 7029de5

Browse files
committed
Swift: Attempt to speed up evaluation of the private information regex for Swift.
1 parent 1f13e46 commit 7029de5

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

swift/ql/lib/codeql/swift/security/SensitiveExprs.qll

+2-2
Original file line numberDiff line numberDiff line change
@@ -64,9 +64,9 @@ class SensitivePrivateInfo extends SensitiveDataType, TPrivateInfo {
6464
override string toString() { result = "private information" }
6565

6666
override string getRegexp() {
67+
// we've had good results for the e-mail heuristic in Swift, which isn't part of the default regex. Add it in.
6768
result = HeuristicNames::maybeSensitiveRegexp(SensitiveDataClassification::private())
68-
or
69-
result = "(?is).*e(mail|_mail).*"
69+
.replaceAll(".*(", ".*(e(mail|_mail)|")
7070
}
7171
}
7272

0 commit comments

Comments
 (0)