File tree Expand file tree Collapse file tree
python/ql/src/semmle/python Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -211,7 +211,7 @@ module Value {
211211 }
212212
213213 /** Gets the `Value` for the integer constant `i`, if it exists.
214- * There will be no `Value` for most integers, but the following are
214+ * There will be no `Value` for most integers, but the following are
215215 * guaranteed to exist:
216216 * * From zero to 511 inclusive.
217217 * * All powers of 2 (up to 2**30)
@@ -486,6 +486,11 @@ class PythonFunctionValue extends FunctionValue {
486486 )
487487 }
488488
489+ /** Gets a control flow node corresponding to a return statement in this function */
490+ ControlFlowNode getAReturnedNode ( ) {
491+ result = this .getScope ( ) .getAReturnValueFlowNode ( )
492+ }
493+
489494}
490495
491496/** Class representing builtin functions, such as `len` or `print` */
Original file line number Diff line number Diff line change @@ -9,8 +9,8 @@ import semmle.python.web.flask.General
99 */
1010class FlaskRoutedResponse extends HttpResponseTaintSink {
1111 FlaskRoutedResponse ( ) {
12- exists ( PyFunctionObject response |
13- flask_routing ( _, response .getFunction ( ) ) and
12+ exists ( PythonFunctionValue response |
13+ flask_routing ( _, response .getScope ( ) ) and
1414 this = response .getAReturnedNode ( )
1515 )
1616 }
Original file line number Diff line number Diff line change @@ -11,8 +11,8 @@ private import semmle.python.web.Http
1111 */
1212class PyramidRoutedResponse extends HttpResponseTaintSink {
1313 PyramidRoutedResponse ( ) {
14- exists ( PyFunctionObject view |
15- is_pyramid_view_function ( view .getFunction ( ) ) and
14+ exists ( PythonFunctionValue view |
15+ is_pyramid_view_function ( view .getScope ( ) ) and
1616 this = view .getAReturnedNode ( )
1717 )
1818 }
Original file line number Diff line number Diff line change @@ -11,8 +11,7 @@ class TwistedResponse extends TaintSink {
1111 isKnownRequestHandlerMethodName ( name ) and
1212 name = func .getName ( ) and
1313 func = getTwistedRequestHandlerMethod ( name ) and
14- func .getScope ( ) = ret .getScope ( ) and
15- ret .getValue ( ) .getAFlowNode ( ) = this
14+ this = func .getAReturnedNode ( )
1615 )
1716 }
1817
You can’t perform that action at this time.
0 commit comments