Skip to content

Commit 70c6744

Browse files
committed
Java/Go/Swift: Sync changes.
1 parent d24f032 commit 70c6744

File tree

5 files changed

+24
-16
lines changed

5 files changed

+24
-16
lines changed

go/ql/lib/semmle/go/dataflow/ExternalFlow.qll

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -299,8 +299,8 @@ predicate hasExternalSpecification(Function f) {
299299
f = any(SummarizedCallable sc).asFunction()
300300
or
301301
exists(SourceSinkInterpretationInput::SourceOrSinkElement e | f = e.asEntity() |
302-
SourceSinkInterpretationInput::sourceElement(e, _, _) or
303-
SourceSinkInterpretationInput::sinkElement(e, _, _)
302+
SourceSinkInterpretationInput::sourceElement(e, _, _, _) or
303+
SourceSinkInterpretationInput::sinkElement(e, _, _, _)
304304
)
305305
}
306306

go/ql/lib/semmle/go/dataflow/internal/FlowSummaryImpl.qll

Lines changed: 8 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -103,11 +103,13 @@ module SourceSinkInterpretationInput implements
103103
* Holds if an external source specification exists for `e` with output specification
104104
* `output`, kind `kind`, and provenance `provenance`.
105105
*/
106-
predicate sourceElement(SourceOrSinkElement e, string output, string kind) {
106+
predicate sourceElement(
107+
SourceOrSinkElement e, string output, string kind, Public::Provenance provenance
108+
) {
107109
exists(
108110
string package, string type, boolean subtypes, string name, string signature, string ext
109111
|
110-
sourceModel(package, type, subtypes, name, signature, ext, output, kind, _) and
112+
sourceModel(package, type, subtypes, name, signature, ext, output, kind, provenance) and
111113
e = interpretElement(package, type, subtypes, name, signature, ext)
112114
)
113115
}
@@ -116,11 +118,13 @@ module SourceSinkInterpretationInput implements
116118
* Holds if an external sink specification exists for `e` with input specification
117119
* `input`, kind `kind` and provenance `provenance`.
118120
*/
119-
predicate sinkElement(SourceOrSinkElement e, string input, string kind) {
121+
predicate sinkElement(
122+
SourceOrSinkElement e, string input, string kind, Public::Provenance provenance
123+
) {
120124
exists(
121125
string package, string type, boolean subtypes, string name, string signature, string ext
122126
|
123-
sinkModel(package, type, subtypes, name, signature, ext, input, kind, _) and
127+
sinkModel(package, type, subtypes, name, signature, ext, input, kind, provenance) and
124128
e = interpretElement(package, type, subtypes, name, signature, ext)
125129
)
126130
}

java/ql/lib/semmle/code/java/dataflow/internal/FlowSummaryImpl.qll

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -192,12 +192,12 @@ module SourceSinkInterpretationInput implements
192192

193193
class Element = J::Element;
194194

195-
predicate sourceElement(Element e, string output, string kind) {
195+
predicate sourceElement(Element e, string output, string kind, Public::Provenance provenance) {
196196
exists(
197197
string namespace, string type, boolean subtypes, string name, string signature, string ext,
198198
SourceOrSinkElement baseSource, string originalOutput
199199
|
200-
sourceModel(namespace, type, subtypes, name, signature, ext, originalOutput, kind, _) and
200+
sourceModel(namespace, type, subtypes, name, signature, ext, originalOutput, kind, provenance) and
201201
baseSource = interpretElement(namespace, type, subtypes, name, signature, ext) and
202202
(
203203
e = baseSource and output = originalOutput
@@ -207,12 +207,12 @@ module SourceSinkInterpretationInput implements
207207
)
208208
}
209209

210-
predicate sinkElement(Element e, string input, string kind) {
210+
predicate sinkElement(Element e, string input, string kind, Public::Provenance provenance) {
211211
exists(
212212
string namespace, string type, boolean subtypes, string name, string signature, string ext,
213213
SourceOrSinkElement baseSink, string originalInput
214214
|
215-
sinkModel(namespace, type, subtypes, name, signature, ext, originalInput, kind, _) and
215+
sinkModel(namespace, type, subtypes, name, signature, ext, originalInput, kind, provenance) and
216216
baseSink = interpretElement(namespace, type, subtypes, name, signature, ext) and
217217
(
218218
e = baseSink and originalInput = input

java/ql/src/utils/modeleditor/FrameworkModeEndpointsQuery.qll

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ private import ModelEditor
88
* A class of effectively public callables from source code.
99
*/
1010
class PublicEndpointFromSource extends Endpoint, ModelApi {
11-
override predicate isSource() { SourceSinkInterpretationInput::sourceElement(this, _, _) }
11+
override predicate isSource() { SourceSinkInterpretationInput::sourceElement(this, _, _, _) }
1212

13-
override predicate isSink() { SourceSinkInterpretationInput::sinkElement(this, _, _) }
13+
override predicate isSink() { SourceSinkInterpretationInput::sinkElement(this, _, _, _) }
1414
}

swift/ql/lib/codeql/swift/dataflow/internal/FlowSummaryImpl.qll

Lines changed: 8 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -119,11 +119,13 @@ module SourceSinkInterpretationInput implements
119119
* Holds if an external source specification exists for `e` with output specification
120120
* `output`, kind `kind`, and provenance `provenance`.
121121
*/
122-
predicate sourceElement(SourceOrSinkElement e, string output, string kind) {
122+
predicate sourceElement(
123+
SourceOrSinkElement e, string output, string kind, Public::Provenance provenance
124+
) {
123125
exists(
124126
string namespace, string type, boolean subtypes, string name, string signature, string ext
125127
|
126-
sourceModel(namespace, type, subtypes, name, signature, ext, output, kind, _) and
128+
sourceModel(namespace, type, subtypes, name, signature, ext, output, kind, provenance) and
127129
e = interpretElement(namespace, type, subtypes, name, signature, ext)
128130
)
129131
}
@@ -132,11 +134,13 @@ module SourceSinkInterpretationInput implements
132134
* Holds if an external sink specification exists for `e` with input specification
133135
* `input`, kind `kind` and provenance `provenance`.
134136
*/
135-
predicate sinkElement(SourceOrSinkElement e, string input, string kind) {
137+
predicate sinkElement(
138+
SourceOrSinkElement e, string input, string kind, Public::Provenance provenance
139+
) {
136140
exists(
137141
string package, string type, boolean subtypes, string name, string signature, string ext
138142
|
139-
sinkModel(package, type, subtypes, name, signature, ext, input, kind, _) and
143+
sinkModel(package, type, subtypes, name, signature, ext, input, kind, provenance) and
140144
e = interpretElement(package, type, subtypes, name, signature, ext)
141145
)
142146
}

0 commit comments

Comments
 (0)