mirror of
https://github.com/github/codeql.git
synced 2026-04-24 00:05:14 +02:00
Swift: Label the now missing cases for CWE-020 and dataflow.
This commit is contained in:
@@ -1,3 +1,2 @@
|
||||
testFailures
|
||||
| test.swift:863:24:864:1 | // $ flow=873\n | Missing result: flow=873 |
|
||||
failures
|
||||
|
||||
@@ -860,7 +860,7 @@ func testVarargs3(_ v: Int, _ args: Int...) {
|
||||
sink(arg: args[1]) // $ flow=873
|
||||
|
||||
for arg in args {
|
||||
sink(arg: arg) // $ flow=873
|
||||
sink(arg: arg) // $ MISSING: flow=873
|
||||
}
|
||||
|
||||
let myKeyPath = \[Int][1]
|
||||
|
||||
@@ -79,9 +79,9 @@ func tests(url: String, secure: Bool) throws {
|
||||
_ = try NSRegularExpression(pattern: #"https?://good.com:8080"#).firstMatch(in: input, range: inputRange) // BAD (missing anchor)
|
||||
|
||||
let trustedUrlRegexs = [
|
||||
"https?://good.com", // BAD (missing anchor), referenced below
|
||||
#"https?:\/\/good.com"#, // BAD (missing anchor), referenced below
|
||||
"^https?://good.com" // BAD (missing post-anchor), referenced below
|
||||
"https?://good.com", // BAD (missing anchor), referenced below [NOT DETECTED]
|
||||
#"https?:\/\/good.com"#, // BAD (missing anchor), referenced below [NOT DETECTED]
|
||||
"^https?://good.com" // BAD (missing post-anchor), referenced below [NOT DETECTED]
|
||||
]
|
||||
for trustedUrlRegex in trustedUrlRegexs {
|
||||
if let _ = try NSRegularExpression(pattern: trustedUrlRegex).firstMatch(in: input, range: inputRange) { }
|
||||
|
||||
Reference in New Issue
Block a user