File tree Expand file tree Collapse file tree 1 file changed +8
-7
lines changed
ruby/ql/lib/codeql/ruby/frameworks Expand file tree Collapse file tree 1 file changed +8
-7
lines changed Original file line number Diff line number Diff line change @@ -21,16 +21,17 @@ module Twirp {
2121 this = API:: getTopLevelMember ( "Twirp" ) .getMember ( "Service" ) .getAnInstantiation ( )
2222 }
2323
24- private DataFlow:: ClassNode getAHandlerClass ( ) {
25- result .getAnImmediateReference ( ) .getAMethodCall ( "new" ) .flowsTo ( this .getArgument ( 0 ) )
26- }
27-
2824 /**
2925 * Gets a handler's method.
3026 */
31- Ast :: Method getAHandlerMethod ( ) {
32- result = this .getAHandlerClass ( ) . getAnAncestor ( ) .getAnOwnInstanceMethod ( ) . asCallableAstNode ( )
27+ DataFlow :: MethodNode getAHandlerMethodNode ( ) {
28+ result = this .getArgument ( 0 ) . backtrack ( ) .getMethod ( _ ) . asCallable ( )
3329 }
30+
31+ /**
32+ * Gets a handler's method as an AST node.
33+ */
34+ Ast:: Method getAHandlerMethod ( ) { result = this .getAHandlerMethodNode ( ) .asCallableAstNode ( ) }
3435 }
3536
3637 /**
@@ -52,7 +53,7 @@ module Twirp {
5253 DataFlow:: ParameterNode
5354 {
5455 UnmarshaledParameter ( ) {
55- exists ( ServiceInstantiation i | i . getAHandlerMethod ( ) .getParameter ( 0 ) = this . asParameter ( ) )
56+ this = any ( ServiceInstantiation i ) . getAHandlerMethodNode ( ) .getParameter ( 0 )
5657 }
5758
5859 override string getSourceType ( ) { result = "Twirp Unmarhaled Parameter" }
You can’t perform that action at this time.
0 commit comments