Skip to content
This repository was archived by the owner on Jan 5, 2023. It is now read-only.

Commit d3d7d2d

Browse files
gagliardettosmowton
authored andcommitted
Simplify UntrustedSources struct fields
1 parent c01259e commit d3d7d2d

File tree

1 file changed

+8
-7
lines changed

1 file changed

+8
-7
lines changed

ql/src/semmle/go/frameworks/CleverGo.qll

Lines changed: 8 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -81,14 +81,15 @@ private module CleverGo {
8181
)
8282
or
8383
// Structs of package: clevergo.tech/clevergo@v0.5.2
84-
exists(DataFlow::Field fld |
85-
// Struct: Context
86-
fld.hasQualifiedName(packagePath(), "Context", "Params")
87-
or
88-
// Struct: Param
89-
fld.hasQualifiedName(packagePath(), "Param", ["Key", "Value"])
84+
exists(string structName, string fields, DataFlow::Field fld |
85+
this = fld.getARead() and
86+
fld.hasQualifiedName(packagePath(), structName, fields)
9087
|
91-
this = fld.getARead()
88+
structName = "Context" and
89+
fields = "Params"
90+
or
91+
structName = "Param" and
92+
fields = ["Value", "Key"]
9293
)
9394
or
9495
// Types of package: clevergo.tech/clevergo@v0.5.2

0 commit comments

Comments
 (0)