Skip to content

Commit ec49c44

Browse files
erik-kroghesbena
andcommitted
Apply suggestions from code review
Co-authored-by: Esben Sparre Andreasen <esbena@github.com>
1 parent 4243504 commit ec49c44

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/HTTP.qll

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -243,17 +243,19 @@ module HTTP {
243243
exists(int i, DataFlow::FunctionNode outer, HTTP::RouteHandlerCandidate inner |
244244
decoratee = call.getArgument(i).getALocalSource() and
245245
outer.getFunction() = call.getACallee() and
246-
outer = returnsARouteHandler(inner) and
246+
returnsRouteHandler(outer, inner) and
247247
isAForwardingRouteHandlerCall(outer.getParameter(i), inner)
248248
)
249249
}
250250

251251
/**
252-
* Gets a function that returns the route-handler-candidate `routeHandler`.
252+
* Holds if `fun` returns the route-handler-candidate `routeHandler`.
253253
*/
254254
pragma[noinline]
255-
private DataFlow::FunctionNode returnsARouteHandler(HTTP::RouteHandlerCandidate routeHandler) {
256-
routeHandler = result.getAReturn().getALocalSource()
255+
private predicate returnsRouteHandler(
256+
DataFlow::FunctionNode fun, HTTP::RouteHandlerCandidate routeHandler
257+
) {
258+
routeHandler = fun.getAReturn().getALocalSource()
257259
}
258260

259261
/**

0 commit comments

Comments
 (0)