Skip to content

Commit 4196230

Browse files
committed
use if-then-else rather than nested exists
1 parent 9e28502 commit 4196230

File tree

1 file changed

+3
-5
lines changed

1 file changed

+3
-5
lines changed

python/ql/src/experimental/Security/UnsafeUnpackQuery.qll

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -84,11 +84,9 @@ class UnsafeUnpackingConfig extends TaintTracking::Configuration {
8484
// see wget: https://pypi.org/project/wget/
8585
exists(API::CallNode mcn |
8686
mcn = API::moduleImport("wget").getMember("download").getACall() and
87-
(
88-
source = mcn.getArg(1)
89-
or
90-
source = mcn.getReturn().asSource() and not exists(Node arg | arg = mcn.getArg(1))
91-
)
87+
if exists(Node arg | arg = mcn.getArg(1))
88+
then source = mcn.getArg(1)
89+
else source = mcn.getReturn().asSource()
9290
)
9391
or
9492
// catch the Django uploaded files as a source

0 commit comments

Comments
 (0)