Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit 43c9f9d

Browse files
committed
C#: Collapse all the specific code for summary, source and sink models into a single file.
1 parent 852d8a2 commit 43c9f9d

4 files changed

Lines changed: 23 additions & 32 deletions

File tree

csharp/ql/src/utils/model-generator/CaptureModels.qll

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -3,9 +3,7 @@
33
* and sink models of the Standard or a 3rd party library.
44
*/
55

6-
private import CaptureSummaryModelsSpecific
7-
private import CaptureSinkModelsSpecific
8-
private import CaptureSourceModelsSpecific
6+
private import CaptureModelsSpecific
97
private import ModelGeneratorUtils
108

119
/**

csharp/ql/src/utils/model-generator/CaptureSinkModelsSpecific.qll renamed to csharp/ql/src/utils/model-generator/CaptureModelsSpecific.qll

Lines changed: 22 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,29 @@
1+
/**
2+
* Provides predicates related to capturing summary models of the Standard or a 3rd party library.
3+
*/
4+
15
import csharp
2-
import semmle.code.csharp.dataflow.TaintTracking
36
import semmle.code.csharp.dataflow.ExternalFlow
7+
import semmle.code.csharp.dataflow.TaintTracking
8+
import semmle.code.csharp.dataflow.internal.DataFlowImplCommon
9+
import semmle.code.csharp.dataflow.internal.DataFlowPrivate
410
import ModelGeneratorUtils
511

12+
/**
13+
* Gets the enclosing callable of `ret`.
14+
*/
15+
Callable returnNodeEnclosingCallable(ReturnNodeExt ret) { result = getNodeEnclosingCallable(ret) }
16+
17+
/**
18+
* Holds if `node` is an own instance access.
19+
*/
20+
predicate isOwnInstanceAccessNode(ReturnNode node) { node.asExpr() instanceof ThisAccess }
21+
22+
/**
23+
* Gets the CSV string representation of the qualifier.
24+
*/
25+
string qualifierString() { result = "Argument[Qualifier]" }
26+
627
class PropagateToSinkConfigurationSpecific extends TaintTracking::Configuration {
728
PropagateToSinkConfigurationSpecific() { this = "parameters or fields flowing into sinks" }
829

csharp/ql/src/utils/model-generator/CaptureSourceModelsSpecific.qll

Lines changed: 0 additions & 4 deletions
This file was deleted.

csharp/ql/src/utils/model-generator/CaptureSummaryModelsSpecific.qll

Lines changed: 0 additions & 24 deletions
This file was deleted.

0 commit comments

Comments
 (0)