Skip to content

Commit dbeb2df

Browse files
authored
Merge pull request #585 from xiemaisi/js/join-order-fiddling
Approved by esben-semmle
2 parents 08f5c2b + dcad2a3 commit dbeb2df

File tree

1 file changed

+6
-4
lines changed
  • javascript/ql/src/semmle/javascript/frameworks

1 file changed

+6
-4
lines changed

javascript/ql/src/semmle/javascript/frameworks/Express.qll

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -127,10 +127,12 @@ module Express {
127127
Expr getRouteHandlerExpr(int index) {
128128
// The first argument is a URI pattern if it is a string. If it could possibly be
129129
// a function, we consider it to be a route handler, otherwise a URI pattern.
130-
if getArgument(0).analyze().getAType() = TTFunction() then
131-
result = getArgument(index)
132-
else
133-
(index >= 0 and result = getArgument(index + 1))
130+
exists (AnalyzedNode firstArg | firstArg = getArgument(0).analyze() |
131+
if firstArg.getAType() = TTFunction() then
132+
result = getArgument(index)
133+
else
134+
(index >= 0 and result = getArgument(index + 1))
135+
)
134136
}
135137

136138
/** Gets an argument that represents a route handler being registered. */

0 commit comments

Comments
 (0)