Skip to content

Commit e930265

Browse files
committed
Use Code Review suggestions
1 parent 06cae62 commit e930265

File tree

2 files changed

+75
-71
lines changed

2 files changed

+75
-71
lines changed

java/src/security/Recursion/Recursion.ql

Lines changed: 6 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -32,9 +32,7 @@ class RecursionSource extends MethodCall {
3232
*/
3333
class ParameterOperation extends Expr {
3434
ParameterOperation() {
35-
this instanceof BinaryExpr
36-
or
37-
this instanceof UnaryAssignExpr and
35+
(this instanceof BinaryExpr or this instanceof UnaryAssignExpr) and
3836
exists(VarAccess va | va.getVariable() = this.getEnclosingCallable().getAParameter() |
3937
this.getAChildExpr+() = va
4038
)
@@ -44,15 +42,15 @@ class ParameterOperation extends Expr {
4442
module RecursiveConfig implements DataFlow::StateConfigSig {
4543
class FlowState = Method;
4644

47-
predicate isSource(DataFlow::Node node, FlowState state) {
45+
predicate isSource(DataFlow::Node node, FlowState firstMethod) {
4846
node.asExpr() instanceof RecursionSource and
49-
state = node.asExpr().(MethodCall).getCaller()
47+
firstMethod = node.asExpr().(MethodCall).getCaller()
5048
}
5149

52-
predicate isSink(DataFlow::Node node, FlowState state) {
50+
predicate isSink(DataFlow::Node node, FlowState firstMethod) {
5351
node.asExpr() instanceof RecursionSource and
54-
state.calls+(node.asExpr().(MethodCall).getCaller()) and
55-
node.asExpr().(MethodCall).getCallee().calls(state)
52+
firstMethod.calls+(node.asExpr().(MethodCall).getCaller()) and
53+
node.asExpr().(MethodCall).getCallee().calls(firstMethod)
5654
}
5755

5856
predicate isBarrier(DataFlow::Node node) {

0 commit comments

Comments
 (0)