Skip to content

Commit 6130679

Browse files
committed
Swift: Label the now missing cases for CWE-020 and dataflow.
1 parent 8bcc5f4 commit 6130679

File tree

3 files changed

+4
-5
lines changed

3 files changed

+4
-5
lines changed
Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,2 @@
11
testFailures
2-
| test.swift:863:24:864:1 | // $ flow=873\n | Missing result: flow=873 |
32
failures

swift/ql/test/library-tests/dataflow/dataflow/test.swift

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -860,7 +860,7 @@ func testVarargs3(_ v: Int, _ args: Int...) {
860860
sink(arg: args[1]) // $ flow=873
861861

862862
for arg in args {
863-
sink(arg: arg) // $ flow=873
863+
sink(arg: arg) // $ MISSING: flow=873
864864
}
865865

866866
let myKeyPath = \[Int][1]

swift/ql/test/query-tests/Security/CWE-020/UnanchoredUrlRegex.swift

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -79,9 +79,9 @@ func tests(url: String, secure: Bool) throws {
7979
_ = try NSRegularExpression(pattern: #"https?://good.com:8080"#).firstMatch(in: input, range: inputRange) // BAD (missing anchor)
8080

8181
let trustedUrlRegexs = [
82-
"https?://good.com", // BAD (missing anchor), referenced below
83-
#"https?:\/\/good.com"#, // BAD (missing anchor), referenced below
84-
"^https?://good.com" // BAD (missing post-anchor), referenced below
82+
"https?://good.com", // BAD (missing anchor), referenced below [NOT DETECTED]
83+
#"https?:\/\/good.com"#, // BAD (missing anchor), referenced below [NOT DETECTED]
84+
"^https?://good.com" // BAD (missing post-anchor), referenced below [NOT DETECTED]
8585
]
8686
for trustedUrlRegex in trustedUrlRegexs {
8787
if let _ = try NSRegularExpression(pattern: trustedUrlRegex).firstMatch(in: input, range: inputRange) { }

0 commit comments

Comments
 (0)