Skip to content

Commit 329684c

Browse files
authored
Merge pull request github#12634 from github/redsun82/swift-successuful-extractions
Swift: add a query showing successfully extracted files
2 parents 218ed8a + ccb816e commit 329684c

File tree

7 files changed

+24
-2
lines changed

7 files changed

+24
-2
lines changed

java/ql/src/Security/CWE/CWE-190/ArithmeticTainted.ql

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,8 @@ module RemoteUserInputOverflow = TaintTracking::Make<RemoteUserInputOverflowConf
3737
module RemoteUserInputUnderflow = TaintTracking::Make<RemoteUserInputUnderflowConfig>;
3838

3939
module Flow =
40-
DataFlow::MergePathGraph<RemoteUserInputOverflow::PathNode, RemoteUserInputUnderflow::PathNode, RemoteUserInputOverflow::PathGraph, RemoteUserInputUnderflow::PathGraph>;
40+
DataFlow::MergePathGraph<RemoteUserInputOverflow::PathNode, RemoteUserInputUnderflow::PathNode,
41+
RemoteUserInputOverflow::PathGraph, RemoteUserInputUnderflow::PathGraph>;
4142

4243
import Flow::PathGraph
4344

java/ql/src/Security/CWE/CWE-200/TempDirLocalInformationDisclosure.ql

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -261,7 +261,9 @@ module InsecureMethodPathGraph implements DataFlow::PathGraphSig<MethodAccessIns
261261
}
262262

263263
module Flow =
264-
DataFlow::MergePathGraph<TempDirSystemGetPropertyToCreate::PathNode, MethodAccessInsecureFileCreation, TempDirSystemGetPropertyToCreate::PathGraph, InsecureMethodPathGraph>;
264+
DataFlow::MergePathGraph<TempDirSystemGetPropertyToCreate::PathNode,
265+
MethodAccessInsecureFileCreation, TempDirSystemGetPropertyToCreate::PathGraph,
266+
InsecureMethodPathGraph>;
265267

266268
import Flow::PathGraph
267269

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
/**
2+
* @name Successfully extracted files
3+
* @description Lists all files in the source code directory that were extracted without encountering a problem in the file.
4+
* @kind diagnostic
5+
* @id swift/diagnostics/successfully-extracted-files
6+
* @tags successfully-extracted-files
7+
*/
8+
9+
import swift
10+
11+
from File f
12+
where
13+
not exists(CompilerError e | e.getFile() = f) and
14+
f.getBaseName().regexpMatch(".*\\.swift\\z")
15+
select f, "File successfully extracted."
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
| main.swift:0:0:0:0 | main.swift | File successfully extracted. |
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
diagnostics/SuccessfullyExtractedFiles.ql
Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
//codeql-extractor-expected-status: 1
2+
#error("Uh oh")

swift/ql/test/query-tests/Diagnostics/main.swift

Whitespace-only changes.

0 commit comments

Comments
 (0)