File tree Expand file tree Collapse file tree
go/ql/lib/semmle/go/frameworks Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -160,21 +160,17 @@ module Twirp {
160160 }
161161 }
162162
163+
163164 /**
164- * A request coming to the service handler
165+ * A request coming to the service handler.
165166 */
166- class Request extends UntrustedFlowSource:: Range , DataFlow:: ParameterNode {
167- ServiceHandler handler ;
168-
167+ class Request extends UntrustedFlowSource:: Range instanceof DataFlow:: ParameterNode {
169168 Request ( ) {
170- handler .getParameter ( 0 ) .getType ( ) .hasQualifiedName ( "context" , "Context" ) and
171- handler .getParameter ( _) = this .asParameter ( ) and
172- this .getType ( ) .( PointerType ) .getBaseType ( ) instanceof ProtobufMessageType
173- }
174-
175- override predicate isParameterOf ( Callable c , int i ) {
176- c .asFunction ( ) = handler and
177- i = 1
169+ exists ( Callable c , ServiceHandler handler | c .asFunction ( ) = handler |
170+ this .isParameterOf ( c , 1 ) and
171+ handler .getParameterType ( 0 ) .hasQualifiedName ( "context" , "Context" ) and
172+ this .getType ( ) .( PointerType ) .getBaseType ( ) instanceof ProtobufMessageType
173+ )
178174 }
179175 }
180176}
You can’t perform that action at this time.
0 commit comments