File tree Expand file tree Collapse file tree 1 file changed +4
-1
lines changed
python/ql/src/experimental/Security/CWE-022bis Expand file tree Collapse file tree 1 file changed +4
-1
lines changed Original file line number Diff line number Diff line change @@ -107,10 +107,13 @@ class Configuration extends TaintTracking::Configuration {
107107 nodeTo = call
108108 )
109109 or
110+ // To handle the case of `with closing(tarfile.open()) as file:`
111+ // we add a step from the first argument of `closing` to the call to `closing`,
112+ // whenever that first argument is a return of `tarfile.open()`.
110113 exists ( API:: CallNode closing |
111114 closing = API:: moduleImport ( "contextlib" ) .getMember ( "closing" ) .getACall ( ) and
112115 nodeFrom = closing .getArg ( 0 ) and
113- nodeFrom = tarfileOpen ( ) .getReturn ( ) .getAValueReachingSink ( ) and
116+ nodeFrom = tarfileOpen ( ) .getReturn ( ) .getAValueReachableFromSource ( ) and
114117 nodeTo = closing
115118 )
116119 }
You can’t perform that action at this time.
0 commit comments