Skip to content

Commit 8767d29

Browse files
committed
Python: Use src for naming in TaintTrackign::Configuration
We picked `src` since this is used much more than `source` in our existing code.
1 parent fc8c1e1 commit 8767d29

File tree

1 file changed

+22
-22
lines changed

1 file changed

+22
-22
lines changed

python/ql/src/semmle/python/dataflow/Configuration.qll

Lines changed: 22 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@ module TaintTracking {
2323

2424
/* Old implementation API */
2525

26-
predicate isSource(Source source) { none() }
26+
predicate isSource(Source src) { none() }
2727

2828
predicate isSink(Sink sink) { none() }
2929

@@ -34,26 +34,26 @@ module TaintTracking {
3434
/* New implementation API */
3535

3636
/**
37-
* Holds if `source` is a source of taint of `kind` that is relevant
37+
* Holds if `src` is a source of taint of `kind` that is relevant
3838
* for this configuration.
3939
*/
40-
predicate isSource(DataFlow::Node node, TaintKind kind) {
41-
exists(TaintSource source |
42-
this.isSource(source) and
43-
node.asCfgNode() = source and
44-
source.isSourceOf(kind)
40+
predicate isSource(DataFlow::Node src, TaintKind kind) {
41+
exists(TaintSource taintSrc |
42+
this.isSource(taintSrc) and
43+
src.asCfgNode() = taintSrc and
44+
taintSrc.isSourceOf(kind)
4545
)
4646
}
4747

4848
/**
4949
* Holds if `sink` is a sink of taint of `kind` that is relevant
5050
* for this configuration.
5151
*/
52-
predicate isSink(DataFlow::Node node, TaintKind kind) {
53-
exists(TaintSink sink |
54-
this.isSink(sink) and
55-
node.asCfgNode() = sink and
56-
sink.sinks(kind)
52+
predicate isSink(DataFlow::Node sink, TaintKind kind) {
53+
exists(TaintSink taintSink |
54+
this.isSink(taintSink) and
55+
sink.asCfgNode() = taintSink and
56+
taintSink.sinks(kind)
5757
)
5858
}
5959

@@ -116,27 +116,27 @@ module TaintTracking {
116116

117117
/* Common query API */
118118

119-
predicate hasFlowPath(PathSource source, PathSink sink) {
120-
this.(TaintTrackingImplementation).hasFlowPath(source, sink)
119+
predicate hasFlowPath(PathSource src, PathSink sink) {
120+
this.(TaintTrackingImplementation).hasFlowPath(src, sink)
121121
}
122122

123123
/* Old query API */
124124

125125
/* deprecated */
126-
predicate hasFlow(Source source, Sink sink) {
127-
exists(PathSource psource, PathSink psink |
128-
this.hasFlowPath(psource, psink) and
129-
source = psource.getNode().asCfgNode() and
126+
predicate hasFlow(Source src, Sink sink) {
127+
exists(PathSource psrc, PathSink psink |
128+
this.hasFlowPath(psrc, psink) and
129+
src = psrc.getNode().asCfgNode() and
130130
sink = psink.getNode().asCfgNode()
131131
)
132132
}
133133

134134
/* New query API */
135135

136-
predicate hasSimpleFlow(DataFlow::Node source, DataFlow::Node sink) {
137-
exists(PathSource psource, PathSink psink |
138-
this.hasFlowPath(psource, psink) and
139-
source = psource.getNode() and
136+
predicate hasSimpleFlow(DataFlow::Node src, DataFlow::Node sink) {
137+
exists(PathSource psrc, PathSink psink |
138+
this.hasFlowPath(psrc, psink) and
139+
src = psrc.getNode() and
140140
sink = psink.getNode()
141141
)
142142
}

0 commit comments

Comments
 (0)