Skip to content

Commit 224db45

Browse files
committed
Ruby: Simplify isRackResponse
1 parent 60f9635 commit 224db45

File tree

1 file changed

+1
-7
lines changed
  • ruby/ql/lib/codeql/ruby/frameworks

1 file changed

+1
-7
lines changed

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

Lines changed: 1 addition & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -10,8 +10,6 @@ private import codeql.ruby.typetracking.TypeTracker
1010
* Provides modeling for the Rack library.
1111
*/
1212
module Rack {
13-
14-
1513
/**
1614
* A class that may be a rack application.
1715
* This is a class that has a `call` method that takes a single argument
@@ -34,11 +32,7 @@ module Rack {
3432

3533
private predicate isRackResponse(DataFlow::Node r) {
3634
// [status, headers, body]
37-
exists(ArrayLiteralCfgNode arr | arr.getNumberOfArguments() = 3 |
38-
r.asExpr() = arr
39-
or
40-
exists(DataFlow::LocalSourceNode n | n.asExpr() = arr | n.flowsTo(r))
41-
)
35+
r.asExpr().(ArrayLiteralCfgNode).getNumberOfArguments() = 3
4236
}
4337

4438
private DataFlow::LocalSourceNode trackRackResponse(TypeTracker t) {

0 commit comments

Comments
 (0)