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

Skip to content

Commit 18d00c1

Browse files
committed
Autoformat QL
1 parent 54d08e1 commit 18d00c1

5 files changed

Lines changed: 20 additions & 15 deletions

File tree

go/ql/lib/semmle/go/frameworks/Revel.qll

Lines changed: 9 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,9 @@ private import semmle.go.security.OpenUrlRedirectCustomizations
88
/** Provides classes and methods modeling the Revel web framework. */
99
module Revel {
1010
/** Gets the package name `github.com/revel/revel`. */
11-
string packagePath() { result = package(["github.com/revel", "github.com/robfig"] + "/revel", "") }
11+
string packagePath() {
12+
result = package(["github.com/revel", "github.com/robfig"] + "/revel", "")
13+
}
1214

1315
private class ControllerParams extends UntrustedFlowSource::Range, DataFlow::FieldReadNode {
1416
ControllerParams() {
@@ -20,7 +22,8 @@ module Revel {
2022
}
2123

2224
private class ParamsFixedSanitizer extends TaintTracking::DefaultTaintSanitizer,
23-
DataFlow::FieldReadNode {
25+
DataFlow::FieldReadNode
26+
{
2427
ParamsFixedSanitizer() {
2528
exists(Field f |
2629
this.readsField(_, f) and
@@ -40,7 +43,8 @@ module Revel {
4043

4144
/** An access to an HTTP request field whose value may be controlled by an untrusted user. */
4245
private class UserControlledRequestField extends UntrustedFlowSource::Range,
43-
DataFlow::FieldReadNode {
46+
DataFlow::FieldReadNode
47+
{
4448
UserControlledRequestField() {
4549
exists(string fieldName |
4650
this.getField().hasQualifiedName(packagePath(), "Request", fieldName)
@@ -53,7 +57,8 @@ module Revel {
5357
}
5458

5559
private class UserControlledRequestMethod extends UntrustedFlowSource::Range,
56-
DataFlow::MethodCallNode {
60+
DataFlow::MethodCallNode
61+
{
5762
UserControlledRequestMethod() {
5863
this.getTarget()
5964
.hasQualifiedName(packagePath(), "Request",

go/ql/lib/semmle/go/security/ExternalAPIs.qll

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,6 @@
44
*/
55

66
import go
7-
87
private import semmle.go.dataflow.FlowSummary
98
private import Xss
109
private import SqlInjectionCustomizations

go/ql/src/Security/CWE-352/ConstantOauth2State.ql

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -107,7 +107,8 @@ class PrivateUrlFlowsToAuthCodeUrlCall extends DataFlow::Configuration {
107107
or
108108
// Propagate across Sprintf and similar calls
109109
exists(DataFlow::CallNode cn |
110-
cn.getACalleeIncludingExternals().asFunction() instanceof Fmt::AppenderOrSprinter |
110+
cn.getACalleeIncludingExternals().asFunction() instanceof Fmt::AppenderOrSprinter
111+
|
111112
pred = cn.getAnArgument() and succ = cn.getResult()
112113
)
113114
}

go/ql/test/library-tests/semmle/go/frameworks/ElazarlGoproxy/test.ql

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -70,9 +70,10 @@ class TaintFlow extends InlineExpectationsTest {
7070
value = "" and
7171
element = "" and
7272
exists(Config c, DataFlow::Node fromNode, DataFlow::Node toNode |
73-
toNode.hasLocationInfo(location.getFile().getAbsolutePath(), location.getStartLine(),
74-
location.getStartColumn(), location.getEndLine(), location.getEndColumn()) and
73+
toNode
74+
.hasLocationInfo(location.getFile().getAbsolutePath(), location.getStartLine(),
75+
location.getStartColumn(), location.getEndLine(), location.getEndColumn()) and
7576
c.hasFlow(fromNode, toNode)
7677
)
7778
}
78-
}
79+
}

go/ql/test/library-tests/semmle/go/frameworks/SQL/QueryString.ql

Lines changed: 5 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -36,9 +36,7 @@ class QueryString extends InlineExpectationsTest {
3636
class Config extends TaintTracking::Configuration {
3737
Config() { this = "pg-orm config" }
3838

39-
override predicate isSource(DataFlow::Node n) {
40-
n.asExpr() instanceof StringLit
41-
}
39+
override predicate isSource(DataFlow::Node n) { n.asExpr() instanceof StringLit }
4240

4341
override predicate isSink(DataFlow::Node n) {
4442
n = any(DataFlow::CallNode cn | cn.getTarget().getName() = "sink").getAnArgument()
@@ -54,10 +52,11 @@ class TaintFlow extends InlineExpectationsTest {
5452
tag = "flowfrom" and
5553
element = "" and
5654
exists(Config c, DataFlow::Node fromNode, DataFlow::Node toNode |
57-
toNode.hasLocationInfo(location.getFile().getAbsolutePath(), location.getStartLine(),
58-
location.getStartColumn(), location.getEndLine(), location.getEndColumn()) and
55+
toNode
56+
.hasLocationInfo(location.getFile().getAbsolutePath(), location.getStartLine(),
57+
location.getStartColumn(), location.getEndLine(), location.getEndColumn()) and
5958
c.hasFlow(fromNode, toNode) and
6059
value = fromNode.asExpr().(StringLit).getValue()
6160
)
6261
}
63-
}
62+
}

0 commit comments

Comments
 (0)