File tree Expand file tree Collapse file tree 1 file changed +5
-7
lines changed
python/ql/src/experimental/semmle/python/frameworks Expand file tree Collapse file tree 1 file changed +5
-7
lines changed Original file line number Diff line number Diff line change @@ -131,21 +131,19 @@ private module Invoke {
131131 * - `invoke.run` or `invoke.sudo` functions (http://docs.pyinvoke.org/en/stable/api/__init__.html)
132132 * - `run` or `sudo` methods on a `invoke.context.Context` instance (http://docs.pyinvoke.org/en/stable/api/context.html#invoke.context.Context.run)
133133 */
134- private class InvokeRunCommandCall extends SystemCommandExecution:: Range {
134+ private class InvokeRunCommandCall extends SystemCommandExecution:: Range , DataFlow:: CfgNode {
135+ override CallNode node ;
136+
135137 InvokeRunCommandCall ( ) {
136- exists ( DataFlow:: Node callFunction |
137- this .asCfgNode ( ) .( CallNode ) .getFunction ( ) = callFunction .asCfgNode ( )
138- |
138+ exists ( DataFlow:: Node callFunction | node .getFunction ( ) = callFunction .asCfgNode ( ) |
139139 callFunction = invoke_attr ( [ "run" , "sudo" ] )
140140 or
141141 callFunction = invoke:: context:: Context:: instanceRunMethods ( )
142142 )
143143 }
144144
145145 override DataFlow:: Node getCommand ( ) {
146- result .asCfgNode ( ) = this .asCfgNode ( ) .( CallNode ) .getArg ( 0 )
147- or
148- result .asCfgNode ( ) = this .asCfgNode ( ) .( CallNode ) .getArgByName ( "command" )
146+ result .asCfgNode ( ) in [ node .getArg ( 0 ) , node .getArgByName ( "command" ) ]
149147 }
150148 }
151149}
You can’t perform that action at this time.
0 commit comments