Skip to content

Commit 236b628

Browse files
committed
Ruby: Constrain parameters flow properly
1 parent 32baf67 commit 236b628

File tree

1 file changed

+6
-5
lines changed

1 file changed

+6
-5
lines changed

ruby/ql/lib/codeql/ruby/frameworks/ActionController.qll

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -386,12 +386,13 @@ private module ParamsSummaries {
386386
ParamsInstance() {
387387
this.asExpr().getExpr() instanceof ParamsCall
388388
or
389-
exists(DataFlow::CallNode call | call = this |
390-
call.getReceiver() instanceof ParamsInstance and
391-
call.getMethodName() = paramsMethodReturningParamsInstance()
392-
)
389+
this =
390+
any(DataFlow::CallNode call |
391+
call.getReceiver() instanceof ParamsInstance and
392+
call.getMethodName() = paramsMethodReturningParamsInstance()
393+
)
393394
or
394-
exists(DataFlow::LocalSourceNode prev | prev.flowsTo(this))
395+
exists(ParamsInstance prev | prev.(DataFlow::LocalSourceNode).flowsTo(this))
395396
}
396397
}
397398

0 commit comments

Comments
 (0)