Skip to content

Commit 08b6755

Browse files
committed
Swift: Simplify hasActualResult.
1 parent e438267 commit 08b6755

File tree

1 file changed

+3
-7
lines changed

1 file changed

+3
-7
lines changed

swift/ql/test/query-tests/Security/CWE-022/PathInjectionTest.ql

Lines changed: 3 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -10,14 +10,10 @@ class PathInjectionTest extends InlineExpectationsTest {
1010
override string getARelevantTag() { result = "hasPathInjection" }
1111

1212
override predicate hasActualResult(Location location, string element, string tag, string value) {
13-
exists(DataFlow::Node source, DataFlow::Node sink, Expr sinkExpr |
13+
exists(DataFlow::Node source, DataFlow::Node sink |
1414
PathInjectionFlow::flow(source, sink) and
15-
(
16-
sinkExpr = sink.asExpr() or
17-
sinkExpr = sink.(DataFlow::PostUpdateNode).getPreUpdateNode().asExpr()
18-
) and
19-
location = sinkExpr.getLocation() and
20-
element = sinkExpr.toString() and
15+
location = sink.getLocation() and
16+
element = sink.toString() and
2117
tag = "hasPathInjection" and
2218
location.getFile().getName() != "" and
2319
value = source.asExpr().getLocation().getStartLine().toString()

0 commit comments

Comments
 (0)