Skip to content

Commit c3679d0

Browse files
hvitvedhmac
authored andcommitted
Fix bad join
1 parent 9880952 commit c3679d0

File tree

1 file changed

+12
-8
lines changed
  • ruby/ql/lib/codeql/ruby/frameworks/actioncontroller

1 file changed

+12
-8
lines changed

ruby/ql/lib/codeql/ruby/frameworks/actioncontroller/Filters.qll

Lines changed: 12 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -35,6 +35,17 @@ module Filters {
3535
}
3636
}
3737

38+
bindingset[call]
39+
pragma[inline_late]
40+
private ActionControllerActionMethod getADescendentAction(MethodCallCfgNode call) {
41+
result = call.getExpr().getEnclosingModule().getAMethod()
42+
or
43+
exists(ModuleBase m |
44+
m.getModule() = call.getExpr().getEnclosingModule().getModule().getAnImmediateDescendent+() and
45+
result = m.getAMethod()
46+
)
47+
}
48+
3849
/**
3950
* A call to a class method that adds or removes a filter from the callback chain.
4051
* This class exists to encapsulate common behavior between calls that
@@ -65,14 +76,7 @@ module Filters {
6576
not exists(this.getOnlyArgument()) and
6677
forall(string except | except = this.getExceptArgument() | result.getName() != except)
6778
) and
68-
(
69-
result = this.getExpr().getEnclosingModule().getAMethod()
70-
or
71-
exists(ModuleBase m |
72-
m.getModule() = this.getExpr().getEnclosingModule().getModule().getADescendent() and
73-
result = m.getAMethod()
74-
)
75-
)
79+
result = getADescendentAction(this)
7680
}
7781

7882
private string getOnlyArgument() {

0 commit comments

Comments
 (0)