Skip to content

Commit 8e2e327

Browse files
committed
Use neutralModel in various places
1 parent 83672f5 commit 8e2e327

File tree

1 file changed

+12
-2
lines changed

1 file changed

+12
-2
lines changed

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

Lines changed: 12 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -193,6 +193,8 @@ module ModelValidation {
193193
predicate sinkKind(string kind) { sinkModel(_, _, _, _, _, _, _, kind, _, _) }
194194

195195
predicate sourceKind(string kind) { sourceModel(_, _, _, _, _, _, _, kind, _, _) }
196+
197+
predicate neutralKind(string kind) { neutralModel(_, _, _, _, kind, _) }
196198
}
197199

198200
private module KindVal = SharedModelVal::KindValidation<KindValConfig>;
@@ -208,6 +210,10 @@ module ModelValidation {
208210
or
209211
summaryModel(package, type, _, name, signature, ext, _, _, _, provenance, _) and
210212
pred = "summary"
213+
or
214+
neutralModel(package, type, name, signature, _, provenance) and
215+
ext = "" and
216+
pred = "neutral"
211217
|
212218
not package.replaceAll("$ANYVERSION", "").regexpMatch("[a-zA-Z0-9_\\./-]*") and
213219
result = "Dubious package \"" + package + "\" in " + pred + " model."
@@ -243,9 +249,13 @@ pragma[nomagic]
243249
private predicate elementSpec(
244250
string package, string type, boolean subtypes, string name, string signature, string ext
245251
) {
246-
sourceModel(package, type, subtypes, name, signature, ext, _, _, _, _) or
247-
sinkModel(package, type, subtypes, name, signature, ext, _, _, _, _) or
252+
sourceModel(package, type, subtypes, name, signature, ext, _, _, _, _)
253+
or
254+
sinkModel(package, type, subtypes, name, signature, ext, _, _, _, _)
255+
or
248256
summaryModel(package, type, subtypes, name, signature, ext, _, _, _, _, _)
257+
or
258+
neutralModel(package, type, name, signature, _, _) and ext = "" and subtypes = false
249259
}
250260

251261
private string paramsStringPart(Function f, int i) {

0 commit comments

Comments
 (0)